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

Merge branch 'master' of http://git.dongkesoft.com:9001/DK-MES-3.0/mes-web

周兴 3 лет назад
Родитель
Сommit
f73c1f63ab

+ 4 - 0
src/api/pages/common/common.js

@@ -127,6 +127,10 @@ export default {
     getLabelPrinter:'get_label_printer',
     //查询打印模板
     getLabelPrintLayout:'get_label_print_layout',
+    //生产查询工种
+    getJobByPage: 'get_job_by_page',
+    //生产查询员工
+    getTeamStaff: 'get_team_staff',
   },
   appCommonService: {
     prefix: 'mdm-server/app/mst/common/',

+ 54 - 0
src/components/business/table-select/table-select.vue

@@ -1489,6 +1489,60 @@ export default {
           {field: 'remarks', width: 'auto'},
         ]
       }
+      //工种
+      else if (this.dataType === this.$config.tableSelectType.job) {
+        this.service = this.$service.commonService
+        this.methodsName = 'getJobByPage'
+        this.methodsNameDetail = 'getJobByPage'
+        // 查询条件
+        this.searchContent = [
+          {
+            valueFormat: {code: 'jobCode'},
+            itemName: 'blameJobCode',
+          },
+          {
+            valueFormat: {code: 'jobName'},
+            itemName: 'blameJobName',
+          },
+        ]
+        this.selectKey = 'jobId'
+        this.selectLabel = 'jobName'
+        this.columns = [
+          {field: 'jobCode', title:this.$t('blameJobCode'), width: 'auto'},
+          {field: 'jobName', title:this.$t('blameJobName'), width: 'auto'},
+        ]
+        this.columnsDetail = [
+          {field: 'jobCode', title:this.$t('blameJobCode'), width: 'auto'},
+          {field: 'jobName', title:this.$t('blameJobName'), width: 'auto'},
+        ]
+      }
+      //责任工号
+      else if (this.dataType === this.$config.tableSelectType.blameUser) {
+        this.service = this.$service.commonService
+        this.methodsName = 'getUserByPage'
+        this.methodsNameDetail = 'getUserByPage'
+        // 查询条件
+        this.searchContent = [
+          {
+            valueFormat: {code: 'userCode'},
+            itemName: 'blameUserCode',
+          },
+          {
+            valueFormat: {code: 'userName'},
+            itemName: 'blameUserName',
+          },
+        ]
+        this.selectKey = 'userId'
+        this.selectLabel = 'userName'
+        this.columns = [
+          {field: 'userCode', title:this.$t('blameUserCode'), width: 'auto'},
+          {field: 'userName', title:this.$t('blameUserName'), width: 'auto'},
+        ]
+        this.columnsDetail = [
+          {field: 'userCode', title:this.$t('blameUserCode'), width: 'auto'},
+          {field: 'userName', title:this.$t('blameUserName'), width: 'auto'},
+        ]
+      }
     },
     /**
      * @desc   : 设置传入数据源的列

+ 1 - 0
src/config/index.js

@@ -757,6 +757,7 @@ export default {
     product: 'product',
     carrier: 'carrier',
     defect: 'defect',
+    blameUser: 'blameUser',
   },
   /**
    * @desc   : 选择类型

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

@@ -251,5 +251,26 @@ export default {
   halfCheckStaff:[
     {updateField: 'blameStaffId', valueFiled: 'staffId'},
     {updateField: 'staffName', valueFiled: 'staffName'},
+    {updateField: 'staffCode', valueFiled: 'staffCode'},
+  ],
+ /**
+  *   @desc   : 半检选择工号
+  *   @date   : 2023/3/7 14:36
+  *   @author : 寇珊珊
+  */
+  halfCheckUser:[
+    {updateField: 'userId', valueFiled: 'userId'},
+    {updateField: 'userName', valueFiled: 'userName'},
+    {updateField: 'userCode', valueFiled: 'userCode'},
+  ],
+ /**
+  *   @desc   : 半检选择工种
+  *   @date   : 2023/3/7 14:36
+  *   @author : 寇珊珊
+  */
+  halfCheckJob:[
+    {updateField: 'jobId', valueFiled: 'jobId'},
+    {updateField: 'jobName', valueFiled: 'jobName'},
+    {updateField: 'jobCode', valueFiled: 'jobCode'},
   ],
 }

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

@@ -303,6 +303,7 @@ export const columns = {
   postName: '职务',
   jobId: '工种',
   jobName: '工种',
+  jobCode: '工种编码',
   userCode: '用户编码',
   userName: '用户名称',
   roleIds: '所属角色',
@@ -736,6 +737,10 @@ export const columns = {
   vehicleCode:'载具码',
   dftFineName:'缺陷扣罚',
   vehicleBarcode:'载具条码',
+  blameUserCode:'工号编码',
+  blameUserName:'工号名称',
+  blameJobCode:'工种编码',
+  blameJobName:'工种名称',
   //工位打卡
   replaceStaffName:'替班员工',
   saveOffWork:'下班(F)',

+ 10 - 1
src/view/pdm/data-collection/climbKiln-add.vue

@@ -10,11 +10,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -124,6 +125,8 @@
         workStationList: [],//工位数据
         barCodeList: [],//产品条码集合
         userKind: null,//用户类型
+        stationFlag:false,//默认工位标识
+
       }
     },
     methods: {
@@ -319,6 +322,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 10 - 2
src/view/pdm/data-collection/finishCheck-add.vue

@@ -11,11 +11,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -268,6 +269,7 @@
         defectPlaceModal: false,//缺陷弹窗
         modalTitle: self.$config.formMode.setDefectPlace,
         defectPlaceList: [],//缺陷位置
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -735,7 +737,7 @@
             if(this.params.productionDefectList[it].blameWsJobId){
               i.blameWsJobId = this.params.productionDefectList[it].blameWsJobId
             }else{
-              i.blameWsJobId=jobId
+              i.blameWsJobId=0
             }
           }
         }
@@ -841,6 +843,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 178 - 97
src/view/pdm/data-collection/halfCheck-add.vue

@@ -11,11 +11,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -72,22 +73,20 @@
                        :height="tableHeight-500"
                        :freeze="false"
                        :add-flag="false" :delete-flag="false"
-                       @current-change="currentChange"
                        @chooseData="chooseData"
                        controlId="defectCode"
                        @changeValue="changeValue"
             ></EditTable>
             <!--责任员工-->
-            <EditTable slot="right" ref="staffTable" :data="staffList" :show-setting-flag="false"
-                       :enabledRepeat="false" enabled-repeat-id="staffId"
-                       :height="tableHeight-500"
-                       :showSettingFlag="false"
-                       :columns="staffColumn"
-                       :add-flag="false" :delete-flag="false"
-                       @delRow="delGroupStaff"
-                       @chooseData="saveDetailChange" @onBatchChoose="saveDetailChange"
-            ></EditTable>
-
+            <DkTable slot="right" ref="staff-table-select" :data="staffList" multiple
+                     :height="tableHeight-500" primaryKey="staffId"
+                     :pageFlag="false"
+                     :pageTotalFlag="false"
+                     :linkClickChecked="true"
+                     @select-change="staffSelectChange($event)"
+                     name="table">
+              <DkTableColumn field="staffName" :title="$t('staffName')" width="auto"></DkTableColumn>
+            </DkTable>
           </DkSplit>
         </DkPanel>
 
@@ -160,8 +159,6 @@
         detailList: [],// 成型记录明细信息
         defectFines: [],//缺陷扣罚
         defectNodeList: [],//责任工序
-        userList: [],//责任工号
-        jobList: [],//责任工种
         staffList: [],//责任员工
         dutyUserList: [],//责任人
         jobId: null,//责任工种
@@ -203,21 +200,41 @@
           },
           // 责任工号
           {
-            field: 'blameUserId',
-            type: 'select',
-            options: () => self.userList,
-            labelKey: 'userName',
-            valueKey: 'userId',
-            width: 'auto'
+            field: 'userName',
+            title: self.$t('blameUserId'),
+            width: 'auto',
+            sortBoolean: false,
+            multiple: false,
+            type: 'tableSelect',
+            param: () => {
+              return {
+                nodeId: self.blameNodeId ? parseInt(self.blameNodeId) : null,
+                productId: self.formData.productId,
+              }
+            },
+            dataType: self.$config.tableSelectType.blameUser,
+            fieldUpdate: self.$updateColumns.halfCheckUser,
+            searchDetailFlag: false,
           },
           // 责任工种
           {
-            field: 'blameWsJobId',
-            type: 'select',
-            options: () => self.jobList,
-            labelKey: 'jobName',
-            valueKey: 'jobId',
-            width: 'auto'
+            field: 'jobName',
+            title: self.$t('blameWsJobId'),
+            width: 'auto',
+            sortBoolean: false,
+            multiple: false,
+            type: 'tableSelect',
+            param: () => {
+              return {
+                nodeId: self.blameNodeId ? parseInt(self.blameNodeId) : null,
+                productId: self.formData.productId,
+                userId: self.userId ? parseInt(self.userId) : null,
+                defectId: self.pdtDefectId ? parseInt(self.pdtDefectId) : null,
+              }
+            },
+            dataType: self.$config.tableSelectType.job,
+            fieldUpdate: self.$updateColumns.halfCheckJob,
+            searchDetailFlag: false
           },
         ],
         //责任员工
@@ -268,6 +285,10 @@
         defectPlaceModal: false,//缺陷弹窗
         modalTitle: self.$config.formMode.setDefectPlace,
         defectPlaceList: [],//缺陷位置
+        stationFlag: false,//默认工位标识
+        userId: null,//当前选择的工号
+        blameNodeId: null,//当前选择的工序
+        pdtDefectId: null,//当前选择的缺陷
       }
     },
     methods: {
@@ -358,6 +379,37 @@
           }
         })
       },
+      /**
+       *   @desc   : 查询员工
+       *   @date   : 2023/3/20 13:18
+       *   @author : 寇珊珊
+       */
+      getStaff() {
+        if (this.blameNodeId) {
+          return
+        }
+        let params = {
+          ftyId: this.formData.ftyId,
+          userId: this.userId?parseInt(this.userId):null,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getTeamStaff, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.staffList = res.data.list
+            for(let i  of this.staffList){
+              i.blameStaffId=i.staffId
+              i.blameWsJobId=i.jobId
+            }
+            if(!this.jobId ||this.staffList.filter(it=>it.jobId==this.jobId).length==0){
+              let _this = this
+              setTimeout(()=>{
+                _this.$refs['staff-table-select'].$refs.table.setAllCheckboxRow(true)
+              }, 200)
+            }
+          } else {
+            this.$Message.error(res.message)
+          }
+        })
+      },
 
       //endregion
 
@@ -384,7 +436,6 @@
           let list = this.gradeList.filter(it => it.gradeId == row)
           if (list.length > 0) {
             this.formData.opnGradeKind = list[0].gradeKind
-            console.log('this.formData.opnGradeKind', this.formData.opnGradeKind)
             //产品等级不为优
             if (this.formData.opnGradeKind != this.$config.gradeKindType.excellent) {
               //调用查询缺陷位置
@@ -417,50 +468,65 @@
               dftFineName: list[0].fineName
             })
           }
-          //查询缺陷数据
-          this.getDefect(rowIndex)
+
         }
         //责任工序
         else if (colItem.field == 'blameNodeId') {
           let list = this.defectNodeList.filter(it => it.nodeId == row.blameNodeId)
           if (list.length > 0) {
-            this.userList = list[0].userList
-            this.jobList = list[0].jobList
+            this.blameNodeId = list[0].nodeId
             //责任工序
             this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
               blameNodeId: list[0].nodeId,
               blameNodeName: list[0].nodeName,
               //责任工号
-              blameUserId: null,
-              blameUserId_Name: null,
+              blameUserId: list[0].userId,
+              blameUserName: list[0].userName,
+              userName: list[0].userName,
               //责任工种
-              blameWsJobId: null,
-              blameWsJobId_Name: null,
+              blameWsJobId: list[0].jobId,
+              blameWsJobName: list[0].jobName,
+              jobName: list[0].jobName,
             })
+            this.userId = list[0].userId
+            this.jobId = list[0].jobId
+            this.detailColumns[6].disabled=true
+            this.detailColumns[7].disabled=true
+            //员工
+            this.staffList= list[0].clockList
+            for(let i  of this.staffList){
+              i.blameStaffId=i.staffId
+              i.blameWsJobId=i.jobId
+            }
+            if(!this.jobId ||this.staffList.filter(it=>it.jobId==this.jobId).length==0){
+              let _this = this
+              setTimeout(()=>{
+                _this.$refs['staff-table-select'].$refs.table.setAllCheckboxRow(true)
+              }, 200)
+            }
           }
         }
         //责任工号
-        else if (colItem.field == 'blameUserId') {
-          let list = this.userList.filter(it => it.userId == row.blameUserId)
-          if (list.length > 0) {
-            //责任工号
-            this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
-              blameUserId: list[0].userId,
-              blameUserName: list[0].userName,
-            })
+      else if (colItem.field == 'userName') {
+          this.userId = row.userId
+          this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
+            blameUserId: row.userId,
+            blameUserName: row.userName,
+          })
+          if(this.userId){
+            //查询员工
+            this.getStaff()
           }
         }
         //责任工种
-        else if (colItem.field == 'blameWsJobId') {
-          let list = this.jobList.filter(it => it.jobId == row.blameWsJobId)
-          if (list.length > 0) {
-            this.jobId = row.blameWsJobId
-            this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
-              //责任工种
-              blameWsJobId: list[0].jobId,
-              blameWsJobName: list[0].jobName,
-            })
-          }
+        else if (colItem.field == 'jobName') {
+          this.jobId = row.jobId
+          this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
+            //责任工种
+            blameWsJobId: row.jobId,
+            blameWsJobName: row.jobName,
+          })
+
         }
         //缺陷位置
         if (colItem.field == 'pdtPlaceId') {
@@ -500,48 +566,41 @@
               //扣罚id
               this.$set(this.detailList[rowIndex], 'pdtDefectId', res.data.defectId)
               this.$set(this.detailList[rowIndex], 'defectName', res.data.defectName)
+              this.pdtDefectId = res.data.defectId
               this.defectFines = res.data.defectFines
+              //查询缺陷数据
+              this.getDefect(rowIndex)
             } else {
               this.$Message.error(res.message)
             }
           })
         }
+        //todo  现在没有小叉叉的清除事件
+        else if (field === 'blameNodeId') {
+          this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
+            blameNodeId:null,
+            blameNodeName: null,
+            //责任工号
+            blameUserId: null,
+            blameUserName: null,
+            userName: null,
+            //责任工种
+            blameWsJobId: null,
+            blameWsJobName: null,
+            jobName: null,
+          })
+          this.userId = null
+          this.jobId = null
+        }
       },
       /**
-       *   @desc   : 删除责任员工
-       *   @date   : 2023/3/7 14:23
-       *   @author : 寇珊珊
-       */
-      delGroupStaff(row, rowIndex) {
-        this.staffList.splice(rowIndex, 1)
-        this.detailList[this.$refs.detailList.currentRowIndex].staffList = this.staffList
-      },
-      /**
-       *   @desc   : 保存责任员工的改动
-       *   @date   : 2023/3/7 14:25
-       *   @author : 寇珊珊
-       */
-      saveDetailChange(field, row, rowIndex) {
-        this.currentChange({
-          rowIndex: this.$refs.recordTable.currentRowIndex,
-          oldRowIndex: this.$refs.recordTable.currentRowIndex
-        })
-      },
-      /**
-       *   @desc   : 行改变时间
-       *   @date   : 2023/2/28 11:22
+       *   @desc   : 责任员工选择
+       *   @date   : 2023/3/20 10:38
        *   @author : 寇珊珊
        */
-      currentChange(e) {
-        if (!this.detailList[e.rowIndex]) {
-          this.detailList[e.rowIndex] = {}
-        }
-        if (Object.keys(e).length == 2 && this.detailList[e.oldRowIndex]) {
-          this.detailList[e.oldRowIndex].prodDefectStaffList = this.$refs.staffTable.tableData
-        }
-        this.staffList = this.detailList[e.rowIndex].prodDefectStaffList || []
+      staffSelectChange(list, row, checked, allFlag) {
+        console.log('staffSelectChange', list, row, checked, allFlag)
       },
-
       /**
        *   @desc   : 删除提交行数据
        *   @date   : 2023/3/10 11:26
@@ -584,26 +643,36 @@
         }
         //endregion
 
-        //region 扣除数
-        if (item.deductNum == null) {
-          this.$Message.error(this.$t('W_069', { 'param': this.$t('deductNum') }))
+        //region 缺陷位置
+        if (item && this.formData.opnGradeKind != this.$config.gradeKindType.excellent &&  item.pdtPlaceId == null) {
+          this.$Message.error(this.$t('W_069', { 'param': this.$t('pdtPlaceId') }))
           this.setErrToRow(item, this.$t('W_093', {
-            'param': this.$t('deductNum')
+            'param': this.$t('pdtPlaceId')
           }))// 给行增加错误提示信息
           return false
         }
         //endregion
 
-        //region 责任工序
-        if (item.blameNodeId == null) {
-          this.$Message.error(this.$t('W_069', { 'param': this.$t('blameNodeId') }))
+        //region 扣除数
+        if (item.deductNum == null) {
+          this.$Message.error(this.$t('W_069', { 'param': this.$t('deductNum') }))
           this.setErrToRow(item, this.$t('W_093', {
-            'param': this.$t('blameNodeId')
+            'param': this.$t('deductNum')
           }))// 给行增加错误提示信息
           return false
         }
         //endregion
 
+        //region 责任工序  todo  目前不是必填的
+        // if (item.blameNodeId == null) {
+        //   this.$Message.error(this.$t('W_069', { 'param': this.$t('blameNodeId') }))
+        //   this.setErrToRow(item, this.$t('W_093', {
+        //     'param': this.$t('blameNodeId')
+        //   }))// 给行增加错误提示信息
+        //   return false
+        // }
+        //endregion
+
         //region 责任工号
         if (item.blameUserId == null) {
           this.$Message.error(this.$t('W_069', { 'param': this.$t('blameUserId') }))
@@ -648,8 +717,9 @@
         if (!this.validDataAddRow()) {
           return
         }
-        this.detailList[0].info =null
-        this.detailList[0].blameStaffName = this.detailList[0].prodDefectStaffList.map(map => map.blameStaffId).toString()
+        this.detailList[0].info = null
+        this.detailList[0].blameStaffName = this.$refs['staff-table-select'].$refs.table.getCheckboxRecords().map(map => map.staffName).toString()
+        this.detailList[0].prodDefectStaffList =this.$refs['staff-table-select'].$refs.table.getCheckboxRecords()
         //缺陷编码
         this.detailList[0].pdtDefectCode = this.detailList[0].defectCode
         //缺陷名称
@@ -730,10 +800,10 @@
           // "pdtViewImageId": 7,
           //   "dftCoordinate": {},
           for (let i of  this.params.productionDefectList[it].prodDefectStaffList) {
-            if(this.params.productionDefectList[it].blameWsJobId){
+            if (this.params.productionDefectList[it].blameWsJobId) {
               i.blameWsJobId = this.params.productionDefectList[it].blameWsJobId
-            }else{
-              i.blameWsJobId=jobId
+            } else {
+              i.blameWsJobId = 0
             }
           }
         }
@@ -839,6 +909,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if (res.data.stationId) {
+              this.formData.stationId = res.data.stationId
+              this.formData.stationName = res.data.stationName
+              this.stationFlag = true
+            }
           } else {
             this.$Message.error(res.message)
           }
@@ -856,6 +932,11 @@
       this.getWorkStation()
       //根据节点id查询工序节点
       this.selectProcessNode()
+    },
+    watch: {
+      staffList(){
+        console.log('staffList', this.staffList)
+      }
     }
   }
 </script>

+ 9 - 1
src/view/pdm/data-collection/inKiln-add.vue

@@ -10,11 +10,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -117,6 +118,7 @@
         userKind: null,//用户类型
         pieceKind: null,//计件模式
         carCodeList: [],//车码集合
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -313,6 +315,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 9 - 1
src/view/pdm/data-collection/outKiln-add.vue

@@ -10,11 +10,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -115,6 +116,7 @@
         userKind: null,//用户类型
         pieceKind: null,//计件模式
         carCodeList: [],//车码集合
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -311,6 +313,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 9 - 2
src/view/pdm/data-collection/recover-add.vue

@@ -9,11 +9,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -93,7 +94,7 @@
         barCodeList: [],//产品条码集合
         pieceKind: null,//计件
         userKind: null,//用户类型
-
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -236,6 +237,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 9 - 1
src/view/pdm/data-collection/register-add.vue

@@ -11,11 +11,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -124,6 +125,7 @@
         opnKind: null,//工序类型
         pieceKind: null,//计件模式
         userKind: null,//用户类型
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -328,6 +330,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }

+ 9 - 1
src/view/pdm/data-collection/uninstallKiln-add.vue

@@ -10,11 +10,12 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+          <DkFormItem v-if="workStationList.length>0 || formData.stationId" :required="true" prop="stationId"
                       :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :disabled="stationFlag"
                              :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
@@ -103,6 +104,7 @@
         workStationList: [],//工位数据
         userKind: null,//用户类型
         carCodeList: [],//车码集合
+        stationFlag:false,//默认工位标识
       }
     },
     methods: {
@@ -258,6 +260,12 @@
               this.formData.prodUserCode = this.$store.state.user.userCode
               this.formData.prodUserId = this.$store.state.user.id
             }
+            //默认工位
+            if(res.data.stationId){
+              this.formData.stationId= res.data.stationId
+              this.formData.stationName= res.data.stationName
+              this.stationFlag=true
+            }
           } else {
             this.$Message.error(res.message)
           }