Commit e9ec5ea3 authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents 72d4b9fd 40e97dca
......@@ -68,6 +68,16 @@ export default {
multiple: true,
options: []
}
}, {
title: '设置检验员',
key: 'testerIds',
component: {
clearable: true,
name: 'el-select',
placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
......@@ -77,6 +87,13 @@ export default {
message: '请填写负责人',
trigger: ['blur', 'change']
}
],
testerIds: [
{
required: true,
message: '请填写检验员',
trigger: ['blur', 'change']
}
]
}
}
......@@ -134,22 +151,65 @@ export default {
if (item.key === 'userIds') {
item.component.options = arr
}
/**
item.key === 'userIds' && (item.component.options = arr.map(row => {
return {
value: row.value,
label: row.label
})
}).catch((err) => {
console.log(err)
})
const httpParams1 = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'source.name',
'operator': 'IN',
'value': ['检验技术员']
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'target',
'pageFrom': 1,
'pageSize': 9999
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/DxGroupMemberLink/search', httpParams1).then(res => {
const arr = []
const ids = []
res.items.content.forEach(item => {
if (ids.indexOf(item.target.id) === -1) {
ids.push(item.target.id)
arr.push({
value: item.target.id,
label: item.target.name + '/' + item.target.number
})
}
})
this.formData[0].data.forEach(item => {
if (item.key === 'testerIds') {
item.component.options = arr
}
))
*/
})
}).catch((err) => {
console.log(err)
})
},
tableToolHandler(e) {
console.log(e.key.btnValue)
if (e.key.btnValue === 'ZGSMApply') {
this.ZGSMApply()
}
......@@ -170,26 +230,28 @@ export default {
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.forEach(item => ids.push(item.id))
}
if (this.form.userIds && this.form.userIds.length !== 0) {
post('/QualityRecord/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
if (this.form.userIds && this.form.userIds.length !== 0 && this.form.testerIds && this.form.testerIds.length !== 0) {
post('/QualityRecord/creator/apply?userIds=' + this.form.userIds + '&testerIds=' + this.form.testerIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData()
}, 1500)
}).catch(err => {
}).catch(() => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(() => {
this.dialogVisible = false
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
this.$set(this.form, 'testerIds', '')
})
} else {
this.$utils.showMessageWarning('请选择审批负责人')
this.$utils.showMessageWarning('请填写相关人员')
}
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
this.$set(this.form, 'testerIds', '')
},
selectionChange(val) {
this.selectionRows = val
......
......@@ -34,7 +34,7 @@ export default {
}
const data = this.$utils.findByNameVnode(this, 'DeeAsCom')
post('/QualityRecord/saveAssessment?id=' + data.basicData.id, this.input).then(() => {
this.$utils.showMessageSuccess('保存成功')
this.$utils.showMessageSuccess('填写内容保存成功')
this.history = this.input
}).catch(() => {
this.$utils.showMessageWarning('出现异常,保存失败')
......
......@@ -40,8 +40,9 @@
import { post } from '@/utils/http'
export default {
name: 'ZGSMApply',
components: {},
name: 'ZGSMList',
componentName: '整改说明',
components: { },
props: {
selectData: {
type: Object,
......@@ -67,6 +68,16 @@ export default {
multiple: true,
options: []
}
}, {
title: '设置检验员',
key: 'testerIds',
component: {
clearable: true,
name: 'el-select',
placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
......@@ -76,6 +87,13 @@ export default {
message: '请填写负责人',
trigger: ['blur', 'change']
}
],
testerIds: [
{
required: true,
message: '请填写检验员',
trigger: ['blur', 'change']
}
]
}
}
......@@ -133,22 +151,65 @@ export default {
if (item.key === 'userIds') {
item.component.options = arr
}
/**
item.key === 'userIds' && (item.component.options = arr.map(row => {
return {
value: row.value,
label: row.label
})
}).catch((err) => {
console.log(err)
})
const httpParams1 = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'source.name',
'operator': 'IN',
'value': ['检验技术员']
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'target',
'pageFrom': 1,
'pageSize': 9999
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/DxGroupMemberLink/search', httpParams1).then(res => {
const arr = []
const ids = []
res.items.content.forEach(item => {
if (ids.indexOf(item.target.id) === -1) {
ids.push(item.target.id)
arr.push({
value: item.target.id,
label: item.target.name + '/' + item.target.number
})
}
})
this.formData[0].data.forEach(item => {
if (item.key === 'testerIds') {
item.component.options = arr
}
))
*/
})
}).catch((err) => {
console.log(err)
})
},
tableToolHandler(e) {
console.log(e.key.btnValue)
if (e.key.btnValue === 'ZGSMApply') {
this.ZGSMApply()
}
......@@ -169,8 +230,8 @@ export default {
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.forEach(item => ids.push(item.id))
}
if (this.form.userIds && this.form.userIds.length !== 0) {
post('/QualityRecord/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
if (this.form.userIds && this.form.userIds.length !== 0 && this.form.testerIds && this.form.testerIds.length !== 0) {
post('/QualityRecord/creator/apply?userIds=' + this.form.userIds + '&testerIds=' + this.form.testerIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData()
......@@ -181,14 +242,16 @@ export default {
this.dialogVisible = false
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
this.$set(this.form, 'testerIds', '')
})
} else {
this.$utils.showMessageWarning('请选择审批负责人')
this.$utils.showMessageWarning('请填写相关人员')
}
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
this.$set(this.form, 'testerIds', '')
},
selectionChange(val) {
this.selectionRows = val
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment