|
|
@@ -88,24 +88,22 @@
|
|
|
<!-- 责任工序-->
|
|
|
<dk-app-single-dropdown typeName="dutyFlowNode" :show="dutyFlowNodeFlag" :pdtDefectId="pdtDefectId"
|
|
|
:barCodeId="barCodeId" :dataListDef="responsibleProcessList"
|
|
|
-
|
|
|
+ :ids="[formData.responsibleProcessId]"
|
|
|
@mutiClose="singleClose('dutyFlowNode')"
|
|
|
@mutiCommit="singleCommit($event,'dutyFlowNode')"></dk-app-single-dropdown>
|
|
|
<!-- 责任工号-->
|
|
|
- <dk-app-single-dropdown typeName="dutyUserCode" :show="dutyUserCodeFlag" :pdtDefectId="pdtDefectId"
|
|
|
- :barCodeId="barCodeId" :dataListDef="userList"
|
|
|
-
|
|
|
+ <dk-app-single-dropdown typeName="dutyUserCode" :show="dutyUserCodeFlag" :productId="formData.uniqueId"
|
|
|
+ :dataListDef="userList"
|
|
|
+ :ids="[formData.userId]"
|
|
|
@mutiClose="singleClose('dutyUserCode')"
|
|
|
@mutiCommit="singleCommit($event,'dutyUserCode')"></dk-app-single-dropdown>
|
|
|
<!-- 责任工种-->
|
|
|
- <dk-app-single-dropdown typeName="dutyKindWork" :show="dutyKindWorkFlag" :pdtDefectId="pdtDefectId"
|
|
|
- :barCodeId="barCodeId" :dataListDef="jobList"
|
|
|
-
|
|
|
+ <dk-app-single-dropdown typeName="dutyKindWork" :show="dutyKindWorkFlag" :productId="formData.uniqueId"
|
|
|
@mutiClose="singleClose('dutyKindWork')"
|
|
|
@mutiCommit="singleCommit($event,'dutyKindWork')"></dk-app-single-dropdown>
|
|
|
<!-- 责任员工-->
|
|
|
- <dk-app-muti-dropdown typeName="staff" :show="staffFlag"
|
|
|
- @mutiClose="mutiClose('staff')"
|
|
|
+ <dk-app-muti-dropdown typeName="staff" :show="staffFlag" :ids="formData.staffIds" :typeFlag="false"
|
|
|
+ @mutiClose="mutiClose('staff')" :dataListDef="clockList"
|
|
|
@mutiCommit="mutiCommit($event,'staff')"></dk-app-muti-dropdown>
|
|
|
<!-- 加载页面 -->
|
|
|
<dk-app-loading :loading="loading"></dk-app-loading>
|
|
|
@@ -121,6 +119,9 @@ export default {
|
|
|
mixins: [appFormMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
+ clockListIds: [],
|
|
|
+ clockList: [],
|
|
|
+ productId: null,
|
|
|
defectDeductionFlag: false, //缺陷扣罚标识
|
|
|
dutyFlowNodeFlag: false, //责任工序
|
|
|
dutyUserCodeFlag: false, //责任工号
|
|
|
@@ -157,6 +158,7 @@ export default {
|
|
|
this.excute(this.$service.appCommonService, this.$service.appCommonService.getCheckPlaceCode, params).then(res => {
|
|
|
if (res.data) {
|
|
|
this.formData.placeId = res.data.placeId
|
|
|
+ this.getBlameNode()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -166,13 +168,12 @@ export default {
|
|
|
* @author : 于继渤
|
|
|
* @date : 2023/3/15 8:47
|
|
|
*/
|
|
|
- getBlameNode(pdtDefectId) {
|
|
|
+ getBlameNode() {
|
|
|
let params = {}
|
|
|
params.ftyId = this.$store.state.user.ftyId
|
|
|
params.barCode = this.formData.barCode
|
|
|
params.barCodeId = this.formData.uniqueId
|
|
|
params.flowNodeId = this.formData.flowNodeId
|
|
|
- params.pdtDefectId = pdtDefectId
|
|
|
this.excute(this.$service.appCollectService, this.$service.appCollectService.getBlameNode, params).then(res => {
|
|
|
if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
if (res.data && res.data.length > 0) {
|
|
|
@@ -182,6 +183,34 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 获取责任员工
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2023/3/21 14:19
|
|
|
+ */
|
|
|
+ getTeamStaff() {
|
|
|
+ let params = {}
|
|
|
+ params.ftyId = this.$store.state.user.ftyId
|
|
|
+ params.userId = this.formData.userId
|
|
|
+ this.excute(this.$service.commonService, this.$service.commonService.getTeamStaff, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+
|
|
|
+ if (res.data.list && res.data.list.length > 0) {
|
|
|
+ this.clockList = res.data.list
|
|
|
+ let ids = []
|
|
|
+ let names = []
|
|
|
+ res.data.list.forEach(it => {
|
|
|
+ ids.push(it.staffId)
|
|
|
+ names.push(it.staffName)
|
|
|
+ })
|
|
|
+ this.formData.staffIds = ids
|
|
|
+ this.formData.staffNames = names.join(',')
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// region 控件 回调
|
|
|
|
|
|
/**
|
|
|
@@ -194,22 +223,36 @@ export default {
|
|
|
this.formData.defectDeductionId = Number(e.ids)
|
|
|
this.formData.defectDeductionName = e.names
|
|
|
this.formData.deductNum = Number(e.deductNum)
|
|
|
- if (Number(e.ids)) {
|
|
|
- // 查询责任工序、工号、工种
|
|
|
- this.getBlameNode(Number(e.ids))
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
if (typeName === 'dutyFlowNode') { //责任工序
|
|
|
this.formData.responsibleProcessId = e.ids
|
|
|
this.formData.responsibleProcess = e.names
|
|
|
- this.jobList = e.jobList
|
|
|
- this.userList = e.userList
|
|
|
- this.formData.jobId = 0
|
|
|
+
|
|
|
+ this.clockList = e.clockList
|
|
|
+ let staffNamesTemp = []
|
|
|
+ let staffIdsTemp = []
|
|
|
+ e.clockList.forEach(it => {
|
|
|
+ staffIdsTemp.push(it.staffId)
|
|
|
+ staffNamesTemp.push(it.staffName)
|
|
|
+
|
|
|
+ })
|
|
|
+ this.formData.staffNames = staffNamesTemp.join(',')
|
|
|
+ this.formData.staffIds = staffIdsTemp
|
|
|
+
|
|
|
+ this.formData.userId = e.userId
|
|
|
+ this.formData.userName = e.userName
|
|
|
+ this.formData.jobId = e.jobId
|
|
|
+ this.formData.jobName = e.jobName
|
|
|
}
|
|
|
|
|
|
if (typeName === 'dutyUserCode') { //责任工号
|
|
|
this.formData.userId = Number(e.ids)
|
|
|
this.formData.userName = e.names
|
|
|
+ if (Number(e.ids)) {
|
|
|
+ this.getTeamStaff()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (typeName === 'dutyKindWork') { //责任工种
|
|
|
@@ -334,7 +377,7 @@ export default {
|
|
|
}
|
|
|
//校验缺陷信息位置重复数据
|
|
|
for (let i = 0; i < this.tableRowData.length; i++) {
|
|
|
- if (this.tableRowData[i].placeId === this.formData.placeId && this.tableRowData[i].defectId ===this.formData.defectId ) {
|
|
|
+ if (this.tableRowData[i].placeId === this.formData.placeId && this.tableRowData[i].defectId === this.formData.defectId) {
|
|
|
this.$appDialog.alert({message: this.$t('appDataDuplication')}).then(res => {
|
|
|
this.formData.placeCode = ''
|
|
|
this.formData.placeId = null
|
|
|
@@ -345,7 +388,7 @@ export default {
|
|
|
}
|
|
|
//校验缺陷明细位置重复数据
|
|
|
for (let i = 0; i < this.productionDefectList.length; i++) {
|
|
|
- if (this.productionDefectList[i].pdtPlaceId === this.formData.placeId && this.productionDefectList[i].prodDefectId ===this.formData.defectId ) {
|
|
|
+ if (this.productionDefectList[i].pdtPlaceId === this.formData.placeId && this.productionDefectList[i].prodDefectId === this.formData.defectId) {
|
|
|
this.$appDialog.alert({message: this.$t('appDataDuplication')}).then(res => {
|
|
|
this.formData.placeCode = ''
|
|
|
this.formData.placeId = null
|
|
|
@@ -383,6 +426,15 @@ export default {
|
|
|
*/
|
|
|
saveCollectData() {
|
|
|
if (this.validData()) {
|
|
|
+ if(this.clockList && this.clockList.length > 0){
|
|
|
+ this.clockList.forEach(res => {
|
|
|
+ this.formData.blameStaff.push(
|
|
|
+ {
|
|
|
+ blameStaffId:res.staffId
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
localStorage.setItem("app-record-process-data", JSON.stringify(this.formData))
|
|
|
this.$router.go(-1)
|
|
|
}
|
|
|
@@ -411,6 +463,9 @@ export default {
|
|
|
if (this.$route.params.productionDefectList) {
|
|
|
this.productionDefectList = this.$route.params.productionDefectList
|
|
|
}
|
|
|
+ if (this.$route.params.responsibleProcessList) {
|
|
|
+ this.responsibleProcessList = this.$route.params.responsibleProcessList
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|