|
|
@@ -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>
|