对接虚拟清单列表

This commit is contained in:
qq787203167
2022-04-11 09:40:39 +08:00
parent 857f3b2108
commit c7a5064fba
3 changed files with 99 additions and 43 deletions
@@ -95,10 +95,10 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('VirtualListName')">{{$t('VirtualListName')}}</span>
</div>
<a-form-model-item class="itemModel" prop="VirtualListName">
<a-form-model-item class="itemModel" prop="name">
<a-input class="box-input-add"
v-model="formInline.VirtualListName"
:placeholder="$t('PleaseEnter')+$t('instructionForUse')"/>
v-model="formInline.name"
:placeholder="$t('PleaseEnter')+$t('VirtualListName')"/>
</a-form-model-item>
</div>
</a-col>
@@ -110,7 +110,7 @@
<a-form-model-item class="itemModel" prop="instructionForUse">
<a-textarea
:placeholder="$t('PleaseEnter')+$t('instructionForUse')"
v-model="formInline.instructionForUse" :rows="4"/>
v-model="formInline.useExplain" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
@@ -136,7 +136,13 @@
loading: false,
selectedRowKeys: [],
formInline: {},
rules: {},
rules: {
name: [{
required: true,
message: this.$t('VirtualListName') + this.$t('cannotEmpty'),
trigger: 'blur'
}]
},
visible: false,
dataSource: [],
confirmLoading: false,
@@ -144,7 +150,8 @@
list: '/dummy/dummyInventoryBaseEO/page',
add: '/dummy/dummyInventoryBaseEO/add',
edit: '/dummy/dummyInventoryBaseEO/edit',
deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch'
deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch',
urlWithdraw: ''//撤回
},
total: 0,
pageSize: 10,
@@ -160,7 +167,7 @@
{
title: this.$t('listStatus'),
align: 'center',
dataIndex: 'state'
dataIndex: 'state_dictText'
},
{
title: this.$t('creater'),
@@ -171,7 +178,7 @@
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: 200,
width: 400,
scopedSlots: { customRender: 'operation' }
}
],
@@ -204,6 +211,7 @@
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
@@ -217,20 +225,61 @@
//编辑
edit(item) {
this.title = '编辑'
this.formInline = item
this.formInline = JSON.parse(JSON.stringify(item))
this.visible = true
},
//撤回
withdraw() {
withdraw(item) {
let _this = this
this.$confirm({
content: _this.$t('confirmWithdraw'),
onOk() {
getAction(_this.url.urlWithdraw, { id: item.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
//维护清单
maintenanceList() {
maintenanceList(item) {
let newUrl = this.$router.resolve({
path: '/virtualListDetails',
query: {
name: item.name,
useExplain: item.useExplain,
id: item.id,
isTrue: false
}
})
window.open(newUrl.href, '_blank')
},
//订阅
subscribe() {
subscribe(val) {
let _this = this
this.$confirm({
content: val.subscribeFlag == 0 || !val.subscribeFlag ? _this.$t('ConfirmSubscribe') : _this.$t('cancelConfirmSubscribe'),
onOk() {
let url = ''
if (val.subscribeFlag == 0 || !val.subscribeFlag) {
url = 'document/bussDocumentLibraryEO/addSubscribe'
} else {
url = 'document/bussDocumentLibraryEO/cancelSubscribe'
}
getAction(url, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
//删除
deleteLib(val) {
@@ -238,15 +287,13 @@
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
_this.verifyBind(val.id, () => {
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
@@ -255,7 +302,12 @@
VirtualListNameClick(item) {
let newUrl = this.$router.resolve({
path: '/virtualListDetails',
query: {}
query: {
name: item.name,
useExplain: item.useExplain,
id: item.id,
isTrue: true
}
})
window.open(newUrl.href, '_blank')
},
@@ -303,22 +355,26 @@
this.visible = false
},
handleSubmit() {
let url = ''
if (this.queryParam.id) {
url = this.url.edit
} else {
url = this.url.add
}
this.confirmLoading = true
postAction(url, this.queryParam).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
this.confirmLoading = true
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
}
})
}