对接虚拟清单列表

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
+1 -1
View File
@@ -638,5 +638,5 @@ module.exports = {
China:'China', China:'China',
onlyOnefileUploaded:'only one file can be uploaded', onlyOnefileUploaded:'only one file can be uploaded',
typeCannotUploaded:'this type of file cannot be uploaded', typeCannotUploaded:'this type of file cannot be uploaded',
confirmWithdraw:'confirm Withdraw',
} }
+1 -1
View File
@@ -642,6 +642,6 @@ module.exports = {
China:'中国', China:'中国',
onlyOnefileUploaded:'只能上传一个文件', onlyOnefileUploaded:'只能上传一个文件',
typeCannotUploaded:'不支持上传该类型的文件', typeCannotUploaded:'不支持上传该类型的文件',
confirmWithdraw:'确认撤回?',
} }
@@ -95,10 +95,10 @@
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('VirtualListName')">{{$t('VirtualListName')}}</span> <span class="title-text-text" :title="$t('VirtualListName')">{{$t('VirtualListName')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="VirtualListName"> <a-form-model-item class="itemModel" prop="name">
<a-input class="box-input-add" <a-input class="box-input-add"
v-model="formInline.VirtualListName" v-model="formInline.name"
:placeholder="$t('PleaseEnter')+$t('instructionForUse')"/> :placeholder="$t('PleaseEnter')+$t('VirtualListName')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -110,7 +110,7 @@
<a-form-model-item class="itemModel" prop="instructionForUse"> <a-form-model-item class="itemModel" prop="instructionForUse">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('instructionForUse')" :placeholder="$t('PleaseEnter')+$t('instructionForUse')"
v-model="formInline.instructionForUse" :rows="4"/> v-model="formInline.useExplain" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -136,7 +136,13 @@
loading: false, loading: false,
selectedRowKeys: [], selectedRowKeys: [],
formInline: {}, formInline: {},
rules: {}, rules: {
name: [{
required: true,
message: this.$t('VirtualListName') + this.$t('cannotEmpty'),
trigger: 'blur'
}]
},
visible: false, visible: false,
dataSource: [], dataSource: [],
confirmLoading: false, confirmLoading: false,
@@ -144,7 +150,8 @@
list: '/dummy/dummyInventoryBaseEO/page', list: '/dummy/dummyInventoryBaseEO/page',
add: '/dummy/dummyInventoryBaseEO/add', add: '/dummy/dummyInventoryBaseEO/add',
edit: '/dummy/dummyInventoryBaseEO/edit', edit: '/dummy/dummyInventoryBaseEO/edit',
deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch' deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch',
urlWithdraw: ''//撤回
}, },
total: 0, total: 0,
pageSize: 10, pageSize: 10,
@@ -160,7 +167,7 @@
{ {
title: this.$t('listStatus'), title: this.$t('listStatus'),
align: 'center', align: 'center',
dataIndex: 'state' dataIndex: 'state_dictText'
}, },
{ {
title: this.$t('creater'), title: this.$t('creater'),
@@ -171,7 +178,7 @@
title: this.$t('operation'), title: this.$t('operation'),
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
width: 200, width: 400,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
@@ -204,6 +211,7 @@
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = [] _this.selectedRowKeys = []
_this.getList()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(_this.$t('operationFailed'))
} }
@@ -217,20 +225,61 @@
//编辑 //编辑
edit(item) { edit(item) {
this.title = '编辑' this.title = '编辑'
this.formInline = item this.formInline = JSON.parse(JSON.stringify(item))
this.visible = true 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) { deleteLib(val) {
@@ -238,15 +287,13 @@
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
onOk() { onOk() {
_this.verifyBind(val.id, () => { getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { if (res.success) {
if (res.success) { _this.$message.success(_this.$t('OperationSuccessful'))
_this.$message.success(_this.$t('OperationSuccessful')) _this.getList()
_this.getList() } else {
} else { _this.$message.warning(_this.$t('operationFailed'))
_this.$message.warning(_this.$t('operationFailed')) }
}
})
}) })
} }
}) })
@@ -255,7 +302,12 @@
VirtualListNameClick(item) { VirtualListNameClick(item) {
let newUrl = this.$router.resolve({ let newUrl = this.$router.resolve({
path: '/virtualListDetails', path: '/virtualListDetails',
query: {} query: {
name: item.name,
useExplain: item.useExplain,
id: item.id,
isTrue: true
}
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
}, },
@@ -303,22 +355,26 @@
this.visible = false this.visible = false
}, },
handleSubmit() { handleSubmit() {
let url = '' this.$refs.ruleForm.validate(valid => {
if (this.queryParam.id) { if (valid) {
url = this.url.edit let url = ''
} else { if (this.formInline.id) {
url = this.url.add url = this.url.edit
} } else {
this.confirmLoading = true url = this.url.add
postAction(url, this.queryParam).then((res) => { }
if (res.success) { this.confirmLoading = true
this.confirmLoading = false postAction(url, this.formInline).then((res) => {
this.$message.success(this.$t('OperationSuccessful')) if (res.success) {
this.visible = false this.confirmLoading = false
this.getList() this.$message.success(this.$t('OperationSuccessful'))
} else { this.visible = false
this.$message.warning(this.$t('operationFailed')) this.getList()
this.confirmLoading = false } else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
} }
}) })
} }