Browse Source

feat(qc): 在质检模板中添加操作用户信息并优化提示消息

- 在新增和删除操作的数据对象中添加 createBy 字段记录操作用户
- 为新增成功操作添加 success 类型的消息提示
- 为删除成功操作添加 success 类型的消息提示
- 优化单条删除操作以包含当前用户的创建信息
- 统一消息提示的持续时间为 1500 毫秒
master
qiankanghui 2 weeks ago
parent
commit
f7af560176
  1. 16
      src/views/modules/qc/qcTemplate.vue
  2. 16
      src/views/modules/qc/qcTemplate2.vue

16
src/views/modules/qc/qcTemplate.vue

@ -1614,6 +1614,7 @@
templateName: this.detailData.templateName,
itemList: this.itemSelections1,
itemType: this.detailData.itemType,
createBy: this.$store.state.user.name,
}
addItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
@ -1622,6 +1623,11 @@
this.itemList2 = data.row2
})
this.itemSelections1 = []
this.$message({
message: '新增成功',
type: 'success',
duration: 1500
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -1642,7 +1648,8 @@
templateId: this.detailData.templateId,
templateName: this.detailData.templateName,
itemList: this.itemSelections2,
itemType: this.detailData.itemType
itemType: this.detailData.itemType,
createBy: this.$store.state.user.name,
}
delItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
@ -1651,6 +1658,11 @@
this.itemList2 = data.row2
})
this.itemSelections2 = []
this.$message({
message: '删除成功',
type: 'success',
duration: 1500
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -1679,7 +1691,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delItemDetails(row).then(({data}) => {
delItemDetails(Object.assign({}, row, {createBy: this.$store.state.user.name})).then(({data}) => {
if (data && data.code === 0) {
templateDetailsSearch(this.detailData).then(({data}) => {
this.detailList = data.rows

16
src/views/modules/qc/qcTemplate2.vue

@ -1682,6 +1682,7 @@
templateName: this.detailData.templateName,
itemList: this.itemSelections1,
itemType: this.detailData.itemType,
createBy: this.$store.state.user.name,
}
addItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
@ -1690,6 +1691,11 @@
this.itemList2 = data.row2
})
this.itemSelections1 = []
this.$message({
message: '新增成功',
type: 'success',
duration: 1500
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -1710,7 +1716,8 @@
templateId: this.detailData.templateId,
templateName: this.detailData.templateName,
itemList: this.itemSelections2,
itemType: this.detailData.itemType
itemType: this.detailData.itemType,
createBy: this.$store.state.user.name,
}
delItemDetails(inData).then(({data}) => {
if (data && data.code === 0) {
@ -1719,6 +1726,11 @@
this.itemList2 = data.row2
})
this.itemSelections2 = []
this.$message({
message: '删除成功',
type: 'success',
duration: 1500
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -1747,7 +1759,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delItemDetails(row).then(({data}) => {
delItemDetails(Object.assign({}, row, {createBy: this.$store.state.user.name})).then(({data}) => {
if (data && data.code === 0) {
templateDetailsSearch(this.detailData).then(({data}) => {
this.detailList = data.rows

Loading…
Cancel
Save