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

Merge remote-tracking branch 'origin/master'

sh4wmoo 2 лет назад
Родитель
Сommit
12791981d9

+ 226 - 0
src/components-app/base/dk-app-select/dk-app-select.vue

@@ -0,0 +1,226 @@
+<!-- @desc:select 下拉组件  @auth:于继渤  @time:2023/05/15 10:47 -->
+<template>
+  <div class="select-container">
+    <div class="input-container">
+
+      <dk-app-field v-model="dataValueTemp" :label="dataLabel" :readonly="true" @click="openDropdown" placeholderType="choose"
+        is-link arrow-direction="down" />
+    </div>
+    <div class="select-content" :class="{ 'active': showSelect }">
+      <div v-for="(item, index) in dataListTemp" class="select-line" @click="select(item)" :key="'select_' + index">
+        <van-cell :title="item.name" />
+        <span v-if="item.checked" class="selected"><i class="iconfont iconseleted"></i></span>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "DkAppSelect",
+  props: {
+    dataValue: {
+      type: String,
+      default: ''
+    },
+    dataLabel: {
+      type: String,
+      default: ''
+    },
+
+    dataList: {
+      type: Array,
+      default: () => ([])
+    },
+    placeholder: {
+      type: String
+    },
+    isSearch: {
+      type: Boolean,
+      default: false
+    },
+    typeName: {
+      type: String
+    },
+    flowNodeId: {
+      type: String
+    }
+
+  },
+  data() {
+    return {
+      showSelect: false,
+
+      dataValueTemp: "",
+      dataListTemp: []
+    }
+  },
+  watch: {
+    dataList(value) {
+      this.dataListTemp = value
+    },
+    dataValue(value){
+      this.dataValueTemp = value
+    }
+
+  },
+
+  methods: {
+
+    getInitData() {
+      this.getData(this.typeName).then(res => {
+        if (res.data && res.data.length > 0) {
+          let listTemp = []
+          res.data.forEach(item => {
+            listTemp.push({
+              name: item.gradeName
+            })
+          })
+          this.dataListTemp = listTemp
+        }
+
+      })
+    },
+
+
+    getData: function (typeName) {
+      let param = {
+        ftyId: this.$store.state.user.ftyId,
+        nodeId: this.flowNodeId
+      }
+      return this.excute(this.$service.commonService, this.$service.commonService.getProductGrade, param)
+    },
+
+
+
+    openDropdown() {
+      this.getInitData()
+      this.showSelect = true
+
+    },
+    inputBlur() {
+      setTimeout(() => {
+        this.showSelect = false
+      }, 100)
+    },
+    select(item) {
+      this.dataValueTemp = item.name;
+      item.checked = true
+      setTimeout(() => {
+        this.showSelect = false
+      }, 100)
+      //   this.$emit("input", item.value);
+    }
+
+
+  },
+  created() {
+  }
+}
+</script>
+
+<style lang="less">
+.select-container {
+  width: 100%;
+  height: 40px;
+  line-height: 40px;
+  background-color: #ffffff;
+  border-radius: 6px;
+  position: relative;
+
+  .input-container {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    .input {
+      flex: 1;
+      border: 0;
+      height: 100%;
+      background-color: transparent;
+      padding: 0px 10px;
+      height: 40px;
+      line-height: 40px;
+    }
+
+    .input-icon {
+      width: 40px;
+      height: 40px;
+      text-align: center;
+
+      .iconfont {
+        font-size: 24px;
+        color: #999999;
+      }
+    }
+  }
+
+  .select-content {
+    position: absolute;
+    width: 100%;
+    top: 42px;
+    left: 0;
+    background-color: #ffffff;
+    z-index: 999999;
+    border-radius: 6px;
+    max-height: 200px;
+    overflow: auto;
+    border: 1px solid #f2f2f2;
+    display: none;
+
+    &.active {
+      display: block;
+      animation: selectanim 0.25s;
+      -webkit-animation: selectanim 0.25s;
+    }
+
+    .select-line {
+      width: 100%;
+      line-height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 10px;
+      border-bottom: 1px solid #f2f2f2;
+
+      &:last-child {
+        border-bottom: 0;
+      }
+
+      .selected {
+        flex-shrink: 0;
+
+        .iconfont {
+          font-size: 24px;
+          color: var(--theme);
+        }
+      }
+    }
+
+    @keyframes selectanim {
+      from {
+        opacity: 0;
+        top: 60px;
+      }
+
+      to {
+        opacity: 1;
+        top: 42px;
+      }
+    }
+
+    @-webkit-keyframes selectanim {
+      from {
+        opacity: 0;
+        top: 60px;
+      }
+
+      to {
+        opacity: 1;
+        top: 42px;
+      }
+    }
+  }
+}
+</style>

+ 2 - 0
src/components-app/base/dk-app-select/index.js

@@ -0,0 +1,2 @@
+import DkAppSelect from "./dk-app-select";
+export default  DkAppSelect;

+ 4 - 0
src/main.js

@@ -589,6 +589,10 @@ Vue.component("dkAppSticky",dkAppSticky)
 import DkAppSearchCond from "@/components-app/base/dk-app-search-cond";
 Vue.component("DkAppSearchCond",DkAppSearchCond)
 
+
+import DkAppSelect from "@/components-app/base/dk-app-select";
+Vue.component("DkAppSelect",DkAppSelect)
+
 import Message from '_c/base/dk-message'
 Vue.prototype.$IBMessage = Message.install
 

+ 101 - 15
src/view-app/app/piecework-procedure/half-check/index.vue

@@ -30,8 +30,24 @@
           :placeholderFlag="false" />
         <!--    产品分级-->
         <dk-app-field v-model="formData.gradeKindName" :label="$t('appProductClassification')" :readonly="true"
-          @click="openDropdown({ key: 'productClassification' })" placeholderType="choose" is-link
-          arrow-direction="down" />
+          placeholderType="choose" />
+
+
+        <!--    产品分级标签-->
+        <div
+          style="display: flex; display: flex;padding-left: 8px; flex-wrap: wrap;align-content: stretch;width: 100%;flex-direction: row; justify-content: flex-start;background: white; align-items: center;">
+          <div v-for="(item, index)  in gradeKindList" :key="index">
+            <div style="padding-left: 5px;margin-top: 2px;">
+              <van-button v-if="item.infotype === 'default'" plain type="info" color="#95A8CB"
+                @click="buttonClick(item, index)" size="small">{{ item.gradeName }}</van-button>
+
+              <van-button v-else type="info" color="#606EB2" size="small">{{
+                item.gradeName }}</van-button>
+            </div>
+          </div>
+        </div>
+
+
         <!--    缺陷号-->
         <dk-app-field v-if="defectFlag" v-model="formData.defectNo" ref="defectNo" :label="$t('appDefectCode')"
           :readonly="readonlyFlag" @changeBarCode="getCheckNodeDefectCode" />
@@ -40,16 +56,21 @@
           :placeholderFlag="false" />
       </div>
     </div>
-    <div v-if="tableRowData.length > 0" style="margin: 10px">{{ $t('appDefectInformation') }}</div>
-    <!--    缺陷信息 list-->
-    <dk-app-table :rows="rows" v-if="tableRowData.length > 0" :tableRowData="tableRowData" :disabledSwipe="false"
-      @onItemRowDelClick="onItemRowDelClick" @openDropdown="openDropdown">
-    </dk-app-table>
-    <div v-if="productionDefectList.length > 0" style="margin: 10px">{{ $t('appDefectInformationDetail') }}</div>
-    <!--    历史缺陷明细-->
-    <dk-app-table :rows="productionDefectListRows" v-if="productionDefectList.length > 0"
-      :tableRowData="productionDefectList" :disabledSwipe="false" @onItemRowDelClick="onItemRowDelClickDefectList">
-    </dk-app-table>
+
+    <div class="main-app-table" ref="scrollTable">
+
+      <div v-if="tableRowData.length > 0" style="margin: 10px">{{ $t('appDefectInformation') }}</div>
+      <!--    缺陷信息 list-->
+      <dk-app-table :rows="rows" v-if="tableRowData.length > 0" :tableRowData="tableRowData" :disabledSwipe="false"
+        @onItemRowDelClick="onItemRowDelClick" @openDropdown="openDropdown">
+      </dk-app-table>
+      <div v-if="productionDefectList.length > 0" style="margin: 10px">{{ $t('appDefectInformationDetail') }}</div>
+      <!--    历史缺陷明细-->
+      <dk-app-table :rows="productionDefectListRows" v-if="productionDefectList.length > 0"
+        :tableRowData="productionDefectList" :disabledSwipe="false" @onItemRowDelClick="onItemRowDelClickDefectList">
+      </dk-app-table>
+    </div>
+
     <!--  保存按钮-->
     <div class="app_save_bottom-class" style="display: flex">
       <dk-app-button v-if="defectFlag" :disabled="loading" @click="onRouterRecordProcess" style="margin: 1px">
@@ -69,6 +90,9 @@
       @mutiCommit="mutiCommit($event, 'register')"></dk-app-single-dropdown>
     <!-- 加载页面   -->
     <dk-app-loading :loading="loading"></dk-app-loading>
+
+
+
   </div>
 </template>
 
@@ -82,6 +106,12 @@ export default {
   data() {
     let self = this
     return {
+      selectedOption: null,
+      options: [
+        { label: '选项1', value: 'option1' },
+        { label: '选项2', value: 'option2' },
+        { label: '选项3', value: 'option3' },
+      ],
       gradeFlag: null,
       stationList: [],      //工位list数据源
       showStation: false,
@@ -134,10 +164,35 @@ export default {
         flowNodeId: this.$route.meta.exMenuUuid,//节点
       },
       appActiveTitle: this.$route.meta.title,
+      gradeKindList: []
     }
   },
   methods: {
     /**
+ * @desc   : 产品等级数据源加载
+ * @author : 于继渤
+ * @date   : 2023/2/7 17:26
+ */
+    getGradeData() {
+      let param = {
+        ftyId: this.$store.state.user.ftyId,
+        nodeId: this.formData.flowNodeId
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getProductGrade, param).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          res.data.forEach(item => {
+            if (item.gradeId === this.formData.gradeKindId) {
+              item.infotype = 'info'
+            } else {
+              item.infotype = 'default'
+            }
+
+          })
+          this.gradeKindList = res.data;
+        }
+      })
+    },
+    /**
      * @desc   : 各个画面最后执行结果
      * @author : 姜永辉
      * @date   : 2023/5/8 16:25
@@ -179,6 +234,7 @@ export default {
         this.setFocus("prodUser") //焦点给到生产工号
         //校验打卡
         this.queryUser()
+        
       }
     },
     /**
@@ -247,6 +303,7 @@ export default {
           this.readonlyFlag = false
           this.productionDefectList = res.data.productionDefectList
           this.productionDefectListTemp = []
+          this.getGradeData()
           if (res.data.opnGradeKind && ((res.data.opnGradeKind.indexOf(this.$t('appExcellent')) === -1))) {
             this.defectFlag = true
           } else {
@@ -270,7 +327,7 @@ export default {
           if (res.data.userKind == null) { // 验证 此工序无此用户
             this.$appDialog.alert({ message: this.$t('W_117'), }).then(() => {
               // 弹出alert后的逻辑处理
-              if (this.handleExcuteAlert) {}
+              if (this.handleExcuteAlert) { }
             });
             return
           }
@@ -386,6 +443,35 @@ export default {
       }
     },
 
+
+    /**
+ * @desc   : 产品分级按钮选择事件
+ * @author : 于继渤
+ * @date   : 2023/2/7 17:26
+ */
+    buttonClick(item, index_z) {
+      this.gradeKindList.forEach((it, index) => {
+        if (index_z === index) {
+          it.infotype = 'info'
+        } else {
+          it.infotype = 'default'
+        }
+      })
+      this.formData.gradeKindId = item.gradeId
+      this.formData.gradeKindName = item.gradeName
+      this.formData.opnGradeKind = item.gradeKind
+      if (item.gradeKind && ((item.gradeKind.indexOf(this.$t('appExcellent')) === -1))) {
+        this.productionDefectList = this.productionDefectListTemp
+        this.defectFlag = true
+      } else {
+        this.productionDefectListTemp = this.productionDefectList
+        this.productionDefectList = []
+        this.defectFlag = false
+        this.formData.defectNo = ''
+        this.formData.defectNoName = ''
+      }
+    },
+
     /**
      * @desc   : 设置焦点
      * @author : 姜永辉
@@ -609,7 +695,7 @@ export default {
   },
   mounted() {
     // 设置滚动的位置和高度
-  //  this.setAppTableHeight(0)
+    //  this.setAppTableHeight(0)
   },
   activated() {
     //改判权限
@@ -640,7 +726,7 @@ export default {
 }
 </script>
 
-<style scoped>
+<style  scoped>
 app-form {
   background: rgb(255, 255, 255);
   margin: 10px;