koushanshan 3 anni fa
parent
commit
429f573bab

+ 3 - 2
src/api/pages/common/common.js

@@ -63,8 +63,8 @@ export default {
     getDictionaryData:'get_dictionary_data',
     // 获取最大窑车序号
     getMaxCarNo:'get_max_carNo',
-    // 获取产品位置
-    getProductPlaceByPage:'get_product_place_by_page',
+    // 获取产品位置不分页
+    getProductPlace:'get_product_place',
     // 获取模具型号
     getModelMouldByPage:'get_model_mould_by_page',
     // 获取可变更产品型号
@@ -119,6 +119,7 @@ export default {
     getProcessFlow:'get_process_flow',
     //获取产品等级
     getProductGrade:'get_product_grade',
+
   },
   appCommonService: {
     prefix: 'mdm-server/app/mst/common/',

+ 2 - 0
src/api/pages/mst/product-defect.js

@@ -6,8 +6,10 @@
 export default {
   productDefectService: {
     prefix: '/mdm-server/mst/productDefect/',
+    //根据编码查询
     getByCode:'get_by_code/',
 
+
   }
 }
 

+ 2 - 0
src/api/pages/pdm/collect.js

@@ -13,6 +13,8 @@ export default {
     checkProdUserCode:'/check_prod_user_code',
     //验证窑炉车号
     checkCarCode:'/check_car_code',
+    //根据编码查询 名称  缺陷扣罚
+    checkNodeDefectCode:'/check_node_defect_code',
 
   }
 }

+ 6 - 4
src/components/business/table-select/table-select.vue

@@ -1404,20 +1404,22 @@ export default {
       //产品位置
       else if (this.dataType === this.$config.tableSelectType.productPlace) {
         this.service = this.$service.commonService
-        this.methodsName = 'getProductPlaceByPage'
-        this.methodsNameDetail = 'getProductPlaceByPage'
+        this.methodsName = 'getProductPlace'
+        this.methodsNameDetail = 'getProductPlace'
         // 查询条件
         this.searchContent = [
           {
-            valueFormat: {code: 'placeName'},
+            valueFormat: {code: 'placeCode'},
           },
         ]
         this.selectKey = 'placeId'
-        this.selectLabel = 'placeName'
+        this.selectLabel = 'placeCode'
         this.columns = [
+          {field: 'placeCode', minWidth: '100'},
           {field: 'placeName', minWidth: '100'},
         ]
         this.columnsDetail = [
+          {field: 'placeCode', minWidth: '100'},
           {field: 'placeName', minWidth: '100'},
         ]
       }

+ 1 - 0
src/libs/update-columns/index.js

@@ -160,6 +160,7 @@ export default {
   productPlaceChooseMould:[
     {updateField: 'placeId', valueFiled: 'placeId'},
     {updateField: 'placeName', valueFiled: 'placeName'},
+    {updateField: 'placeCode', valueFiled: 'placeCode'},
   ],
 
   /**

+ 1 - 0
src/locale/lang/zh-CN.js

@@ -725,6 +725,7 @@ export const columns = {
   barCode:'产品条码',
   modelMouldCode:'模具编码',
   flgRecycled:'回收标识',
+  fineId:'缺陷扣罚',
   //工位打卡
   replaceStaffName:'替班员工',
   saveOffWork:'下班(F)',

+ 3 - 2
src/view/mst/product-view/config/ProductView.js

@@ -46,6 +46,7 @@ export default class Product {
       container: dom,//获取节点
       background: {color: '#F2F7FA',},//画布背景色
       autoResize:true,//自动设置宽高
+      scroller: true,//画布滚动
       panning: {//开启拖拽画布
         enabled: true,
         eventTypes: 'rightMouseDown',//触发画布平移的交互方式为“右键按下”
@@ -163,12 +164,12 @@ export default class Product {
       target: this.graph,
       stencilGraphWidth: 200,
       stencilGraphHeight: 500,
-      collapsable: true,
+      collapsable: false,
       groups: [
         {
           title: '区域图形',
           name: 'group',
-          graphHeight: 500,
+          graphHeight: 400,
           layoutOptions: {
             columns: 1,
             marginX: 35,

+ 60 - 22
src/view/mst/product-view/form.vue

@@ -28,6 +28,7 @@
             <Icon type="ios-camera" size="32"/>
           </div>
           <input
+            accept=".jpg, .jpeg, .png"
             id="upload"
             type="file"
             @change="uploadError"
@@ -47,7 +48,7 @@
 
       <!--画布-->
       <DkPanel prop="productGraph">
-        <DkRow slot="content" style=" height: 400px;overflow: auto">
+        <DkRow slot="content" style=" height: 500px;overflow: auto">
           <Layout>
             <!--   左侧工具栏   -->
             <Sider :width="180">
@@ -84,6 +85,7 @@
                    :operateFlag="false"
                    :newRowFlag="false"
                    :freeze="false"
+                   @chooseData="chooseData"
                    :columns="imageColumn" :height="200" @addRow="addGraphRow" @delRow="delGraphRow"
         ></EditTable>
       </DkPanel>
@@ -120,6 +122,7 @@
           viewName: null,
           remarks: null,
           fileList: [],
+          ftyId:self.$store.state.user.ftyId
         },
         //图片总单
         picFormData: {
@@ -133,26 +136,25 @@
         imageUrl: null,//当前图片地址
         imageColumn: [
           // {field: 'imageName', type: 'text', width: 150},//图片名称
-          { field: 'displayNo', type: 'number', width: 100 },//显示顺序
+          { field: 'displayNo', type: 'number', width: 'auto' },//显示顺序
           // {field: 'imageRemarks', type: 'text', width: 200},//图片备注
           {
-            field: 'placeName',
-            width: 200,
-            type: 'tableSelect',
-            param: () => {
-              return {}
-            },
-            sortBoolean: false,
-            dataType: self.$config.tableSelectType.productPlace,
-            fieldUpdate: self.$updateColumns.productPlaceChooseMould,
-            searchDetailFlag: false,
+            field: 'placeId',
+            title: self.$t('placeCode'),
+            width:'auto',
+            type: 'select',
+            options: () => self.placeList,
+            labelKey: 'placeCode',
+            valueKey: 'placeId',
           },//产品位置
+          { field: 'placeName', type: 'disabled', width:'auto'},//位置名称
           { field: 'remarks', type: 'text', width: 'auto' },//位置备注
         ],
         imageColumnList: [],
         nowPicIndex: 0,//当前图片下标
         nowImage: null,// 当前图片
         graphNodeList: [],//画布节点
+        placeList:[],//位置集合
       }
     },
     watch: {
@@ -257,6 +259,7 @@
         // console.log('34343',this.imageList)
         // 图片列表有数据
         //文件集合赋值   图片名称,显示顺序,备注, 产品位置集合
+        console.log('this.picFormData',this.picFormData)
         if (this.picFormData.imageName) {
           this.$set(this.fileList[this.nowPicIndex], 'imageName', this.picFormData.imageName)
         }
@@ -302,11 +305,11 @@
               this.getNodeClick(val)
             })
             this.graph.fromJSON(this.fileList[index].placeRange)
-            this.picFormData = {
-              imageName: this.fileList[index].imageName,
-              displayNo: this.fileList[index].displayNo,
-              remarks: this.fileList[index].remarks,
-            }
+          }
+          this.picFormData = {
+            imageName: this.fileList[index].imageName,
+            displayNo: this.fileList[index].displayNo,
+            remarks: this.fileList[index].remarks,
           }
           this.nowPicIndex = index
           if (!this.fileList[index].imageId) {
@@ -334,6 +337,7 @@
           )
           //清除画布
           this.graph.removeCells(this.graphNodeList)
+          this.graph.clearCells()
         } else {
           // 如果删除的不是当前行,要处理图形
           if (this.graph.toJSON()?.cells.length > 0 && this.fileList[this.nowPicIndex]) {//如果切换的产品图片有图形的话
@@ -369,6 +373,7 @@
             })
           })
         }
+        document.getElementById('upload').value=null
       },
       /**
        *   @desc   : 图片转换base64
@@ -411,6 +416,20 @@
 
 
       },
+
+      /**
+       *   @desc   : 选择改变
+       *   @date   : 2023/3/3 16:30
+       *   @author : 寇珊珊
+       */
+      chooseData (row, rowIndex, colItem) {
+        if(colItem.field == 'placeId'){
+          let list  = this.placeList.filter(it=>it.placeId ==row.placeId )
+          if(list.length>0){
+            this.$set(this.imageColumnList[rowIndex],'placeName',list[0].placeName)
+          }
+        }
+      },
       /**
        *   @desc   : 添加图片列表行
        *   @date   : 2023/2/8 16:30
@@ -423,7 +442,7 @@
         // this.$set(this.imageColumnList[rowIndex], 'placeRangeId', value.id)
         if (rowIndex || rowIndex === 0) {
           this.$set(this.imageColumnList[rowIndex], 'displayNo', rowIndex + 1)
-          this.$set(this.imageColumnList[rowIndex], 'placeName', null)
+          this.$set(this.imageColumnList[rowIndex], 'placeCode', null)
         }
       },
       /**
@@ -465,7 +484,7 @@
         //校验图片列表中位置名称重复
         for (let it of this.fileList) {
           if (it.productViewPlaceVOList) {
-            noList = noList.concat(it.productViewPlaceVOList.copy().filter(f => f.placeName).map(m => m.placeName))
+            noList = noList.concat(it.productViewPlaceVOList.copy().filter(f => f.placeCode).map(m => m.placeCode))
           }
           if (noList.length != noList.unique().length) {
             this.$Message.error(this.$t('W_102'))
@@ -484,14 +503,14 @@
         for (let item of this.fileList) {
           for (let index = 0; index < item.productViewPlaceVOList.length; index++) {
             let it = item.productViewPlaceVOList[index]
-            if (it.placeName == null) {
+            if (it.placeCode == null) {
               let rows = 1 + parseInt(index)
               this.$message.error(this.$t('W_089', {
                 'param1': rows + this.$t('rowNo'),
-                'param2': this.$t('placeName')
+                'param2': this.$t('placeCode')
               }))
               this.setErrToRow(it, this.$t('W_093', {
-                'param': this.$t('placeName')
+                'param': this.$t('placeCode')
               }))// 给行增加错误提示信息
               return false
             }
@@ -669,7 +688,23 @@
         //   }
         // })
       },
+      getPlace(){
+        let params = {
+          ftyId: this.formData.ftyId,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getProductPlace, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.placeList = res.data
+          } else {
+            this.$Message.error(res.message)
+          }
+        })
+      }
 
+    },
+    created() {
+      //获取位置
+      this.getPlace()
     }
   }
 </script>
@@ -686,6 +721,9 @@
     border-right: 1px solid #dfe3e8;
   }
 
+  /deep/ .dk-collapse-content{
+    padding: 3px 0 50px 16px;
+  }
   #graph-container {
     width: calc(100% - 180px);
     height: 100%;

+ 13 - 3
src/view/mst/product-view/index.vue

@@ -32,6 +32,7 @@
       <!--产品视图-->
       <DkTable slot="top"  :id="'table-'+$options.name" ref="table-select"
                :data="tableData"
+               name="table"
                :height="this.tableHeight * split - 45"
                :pageFlag="true"
                :page-total="pageInfo.total"
@@ -127,6 +128,7 @@
           let params = {
             viewId: row.viewId,
             ftyId: this.$store.state.user.ftyId,
+            flgValid: true,
           }
           this.excute(this.$service.productViewImage, this.$service.productViewImage.selectByCond, params).then(res => {
             if (res.code === this.$config.SUCCESS_CODE) {
@@ -144,7 +146,8 @@
         if (row) {
           let params = {
             ftyId: this.$store.state.user.ftyId,
-            imageId: row.imageId
+            imageId: row.imageId,
+            flgValid: true,
           }
           this.excute(this.$service.productViewPlace, this.$service.productViewPlace.selectByCond, params).then(res => {
             if (res.code === this.$config.SUCCESS_CODE) {
@@ -160,7 +163,7 @@
        *   @author : 寇珊珊
        */
       pageSizeChange(pageInfo) {
-        this.searchData(pageInfo.currentPage) // 查询数据
+        this.searchData(pageInfo) // 查询数据
       },
       /**
        *   @desc   : switch停用启用
@@ -181,7 +184,14 @@
        */
       getData(params) {
         // 查询数据
-        return this.excute(this.$service.productView, this.$service.productView.selectByCond, params)
+        var excute = this.excute(this.$service.productView, this.$service.productView.selectByCond, params)
+        excute.then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.picTableData = []
+            this.placeTableData = []
+          }
+        });
+        return excute
       },
       // endregion
 

+ 48 - 16
src/view/pdm/data-collection/halfCheck-add.vue

@@ -67,6 +67,7 @@
                      :new-row-flag="true"
                      :freeze="false"
                      @current-change="currentChange"
+                     @chooseData="chooseData"
                      @changeValue="changeValue"></EditTable>
         </div>
       </DkPanel>
@@ -96,6 +97,7 @@
           prodUserCode: '',
           barCode: '',
           ftyId: this.$store.state.user.ftyId,
+          productId:null,
           productCode: '',
           productName: '',
           logoName: '',
@@ -113,8 +115,7 @@
         dutyUserCodeList: [],//责任工号
         dutyJobList: [],//责任工种
         dutyUserList: [],//责任人
-        defectFinetList: [],//缺陷扣罚
-        defectFinetNumList: [],//扣除数
+        defectFines: [],//缺陷扣罚
         // 明细列表
         detailColumns: [
           // 缺陷编码
@@ -142,10 +143,18 @@
           { field: 'modelName', title: self.$t('appProductName'), type: 'disabled', width: 'auto' },
           // 责任人
           { field: 'moldlineItemCode', title: self.$t('moldingModelCode'), type: 'disabled', width: 'auto' },
-          // 缺陷扣罚
-          { field: 'moldlineItemKindName', title: self.$t('mouldKindName'), type: 'disabled', width: 'auto' },
+          //缺陷扣罚
+          {
+            field: 'fineId',
+            title: self.$t('defectFines'),
+            type: 'select',
+            options: () => self.defectFines,
+            labelKey: 'fineName',
+            valueKey: 'fineId',
+            width: 'auto'
+          },
           // 扣除数
-          { field: 'productUniqueCode', title: self.$t('pdtUniqueCode'), type: 'text', width: 'auto' },
+          { field: 'deductNum',  type: 'disabled', width: 'auto' },
           // 特殊
           { field: 'moldingBatch', type: 'disabled', width: 'auto' },
         ],
@@ -210,6 +219,7 @@
         }
         this.excute(this.$service.collectService, this.$service.collectService.checkBarCode, params).then(res => {
           if (res.code === this.$config.SUCCESS_CODE) {
+            this.formData.productId = [res.data.uniqueId]
             this.formData.productCode = [res.data.modelCode]
             this.formData.productName = [res.data.modelName]
             this.formData.logoName = [res.data.logoName]
@@ -260,6 +270,21 @@
         console.log('e', e)
       },
       /**
+       *   @desc   : 选择改变
+       *   @date   : 2023/3/3 16:30
+       *   @author : 寇珊珊
+       */
+      chooseData (row, rowIndex, colItem) {
+        //缺陷扣罚
+        if(colItem.field == 'fineId'){
+            let list  = this.defectFines.filter(it=>it.fineId ==row.fineId )
+            if(list.length>0){
+              this.$set(this.detailList[rowIndex],'dftFineId',list[0].fineId)
+              this.$set(this.detailList[rowIndex],'deductNum',list[0].deductNum)
+            }
+          }
+      },
+      /**
        *   @desc   : 值改变
        *   @date   : 2023/2/28 11:23
        *   @author : 寇珊珊
@@ -268,18 +293,25 @@
         if(!this.detailList[rowIndex]){
           this.detailList.splice(rowIndex,0,{})
         }
-        let params = {
-          ftyId: this.formData.ftyId,
-          defectCode: row[field],
-        }
-        this.excute(this.$service.productDefectService, this.$service.productDefectService.getByCode, params).then(res => {
-          if (res.code === this.$config.SUCCESS_CODE) {
-            this.$set(this.detailList[rowIndex],'defectCode',row[field])
-            this.$set(this.detailList[rowIndex],'defectName',res.data.defectName)
-          } else {
-            this.$Message.error(res.message)
+        //缺陷编码
+        if(field === 'defectCode'){
+          let params = {
+            flowNodeId: this.flowNodeId,
+            ftyId: this.formData.ftyId,
+            defectCode: row[field],
           }
-        })
+          this.excute(this.$service.collectService, this.$service.collectService.checkNodeDefectCode, params).then(res => {
+            if (res.code === this.$config.SUCCESS_CODE) {
+              this.$set(this.detailList[rowIndex],'defectCode',row[field])
+              //扣罚id
+              this.$set(this.detailList[rowIndex],'pdtDefectId',res.data.defectId)
+              this.$set(this.detailList[rowIndex],'defectName',res.data.defectName)
+              this.defectFines = res.data.defectFines
+            } else {
+              this.$Message.error(res.message)
+            }
+          })
+        }
 
       },
       /**