Commit d395ed44 authored by xioln's avatar xioln

废品通知单

parent d2973864
......@@ -318,12 +318,11 @@ export default {
this.$refs.form && this.$refs['form'].resetFields()
if (val) {
this.item = val
this.$set(this.form, 'gysign', val.assigneeName)
Object.keys(this.form).forEach((key) => {
Object.keys(val.primaryBusinessObject).forEach((key2) => {
Object.keys(val).forEach((key2) => {
if (key === key2) {
if (val.primaryBusinessObject[key2]) {
this.$set(this.form, key, val.primaryBusinessObject[key2])
if (val[key2]) {
this.$set(this.form, key, val[key2])
}
}
})
......@@ -353,103 +352,22 @@ export default {
}
},
created() {
this.getUserGroup()
this.open(this.$attrs['basic-data'])
},
mounted() {},
methods: {
// 打开弹出框
open(val) {
if (
this.$route.query.name === '我的请求' ||
this.$route.query.name === '办结任务' ||
this.$route.query.name === '已办任务' ||
this.$route.query.name === '废品通知单详情'
) {
this.disabled = true
} else {
// 成本核算员节点Activity_1lgytbi和财务部会计Activity_07owud7
if (['Activity_1lgytbi', 'Activity_07owud7'].includes(val.taskkey)) {
this.disabled = false
}
this.$nextTick(() => {
this.visible = true
this.item = val
})
},
// 获取用户群组
getUserGroup() {
const params = {
searchItems: {
children: [{}],
items: [
{
fieldName: 'userId',
operator: 'EQ',
value: localStorage.getItem('userId')
}
],
operator: 'AND'
},
sortItem: [
{
fieldName: 'id',
sortOrder: 'asc'
}
]
}
this.HttpRequest('/UserGroupRef/find/recursion', params, 'post')
.then((res) => {
res.items.content.forEach((item) => {
if (item.groupName === '成本核算员') {
// this.costEstimator = false
this.$nextTick(() => {
// this.$set(this.rules, 'quota', [
// {
// required: true,
// message: '请输入单件定额',
// trigger: 'blur'
// }
// ])
// this.$set(this.rules, 'consumeCount', [
// {
// required: true,
// message: '请输入消耗总数',
// trigger: 'blur'
// }
// ])
// this.$set(this.rules, 'price', [
// {
// required: true,
// message: '请输入单位价格',
// trigger: 'blur'
// }
// ])
// this.$set(this.rules, 'lossValue', [
// {
// required: true,
// message: '请输入损失价值',
// trigger: 'blur'
// }
// ])
// this.$set(this.rules, 'subMaterialLossValue', [
// {
// required: true,
// message: '请输入辅助材料损失价值',
// trigger: 'blur'
// }
// ])
// this.$set(this.rules, 'totalLossValue', [
// {
// required: true,
// message: '请输入合计损失总值',
// trigger: 'blur'
// }
// ])
})
} else if (item.groupName === '工艺员' && this.$route.query.taskKey === 'Activity_067g61s') {
// } else if (item.groupName === '工艺员') {
// if (val.taskkey === 'Activity_1lgytbi') {
// } else
if (val.taskkey === 'Activity_07owud7') {
this.technologist = false
this.$nextTick(() => {
this.$set(this.form, 'gysign', item.userName)
this.$set(this.form, 'gysign', localStorage.getItem('user'))
this.technologist = false
this.$set(this.rules, 'portCarNumber', [
{
required: true,
......@@ -487,25 +405,23 @@ export default {
])
})
}
})
})
.catch((err) => console.log(err))
.finally(() => {})
} else {
this.disabled = true
}
this.item = val
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.disab = true
const params = {
id: this.item.pboId,
dxClassname: 'com.tf.mes.vo.prodTask.ScrapNoticeDocVO', // 指定类路径
subTypeName: 'ScrapNoticeDoc', // 指定类型
id: this.item.id,
operator: 'MODIFY', // 增加操作
...this.form
}
this.HttpRequest('/ScrapNoticeDoc/recursion', params, 'post')
.then((res) => {
this.$api.recursion('ScrapNoticeDoc', params).then((res) => {
this.reset('保存')
this.item = res.items
})
.catch((err) => console.log(err))
.finally(() => {
......@@ -518,11 +434,11 @@ export default {
})
},
handleClose() {
this.visible = false
this.$emit('cancel')
},
// 重置弹出框
reset(message) {
this.visible = false
this.handleClose()
this.$message({
message: `${message}成功`,
type: 'success'
......
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