Commit d2de3264 authored by 王飞龙's avatar 王飞龙

药品bug

parent bbe13e1d
......@@ -51,23 +51,26 @@
<el-row>
<el-col :span="12" style="padding-bottom: 20px;">
<el-button
id="all-choice"
class="fourWordswhiteBtn"
@click="checkAll"
@click="checkAll('all-choice')"
>
<svg-icon style="margin-right: 1px" icon-class="shuaixuan_icon_quanbu" />
选择全部
</el-button>
<el-button
id="re-choice"
class="fourWordswhiteBtn"
@click="reverseSelection"
@click="reverseSelection('re-choice')"
>
<svg-icon style="margin-right: 1px" icon-class="shuaixuan_icon_fanxiang" />
反向选择
</el-button>
<el-button
id="export-handle"
v-hasPermi="['business:device:export']"
class="fourWordswhiteBtn"
@click="handleExport"
@click="handleExport('export-handle')"
>
<svg-icon style="margin-right: 1px" icon-class="shaixuan_icon_daochu" />
批量导出
......@@ -938,10 +941,11 @@ export default {
})
},
// 选择全部
checkAll() {
checkAll(allChoiceButtonId) {
this.ids = this.idsForever
// 调用手动勾选
this.manualCheck()
document.getElementById(allChoiceButtonId).blur()
},
// 禁止输入空格
keydown(e) {
......@@ -966,7 +970,7 @@ export default {
},
// 反向选择(把永久临时集合和变化的临时集合做减法重新赋给变化的临时集合赋给)
reverseSelection() {
reverseSelection(reChoice) {
const temp = []
this.idsForever.forEach(item => {
if (!this.ids.includes(item)) {
......@@ -976,6 +980,7 @@ export default {
this.ids = temp
console.log('反选的数据', this.ids)
this.manualCheck()
document.getElementById(reChoice).blur()
},
// 表格当前手动勾选的
selectChange(selection, row) {
......@@ -1043,16 +1048,20 @@ export default {
return formattedDate
},
/** 导出按钮操作 */
handleExport() {
handleExport(exportButtonId) {
if (this.ids.length !== 0) {
const exportTable = {}
exportTable.exportIds = this.ids.join(',')
this.download('/finance/stock/outbound/export', exportTable, `配药出库-${this.exportFormatTime(new Date())}.xlsx`).then(res => {
this.$refs.table.clearSelection()
this.ids = []
}).finally(() => {
/* 最后给特定的id进行设置 */
document.getElementById(exportButtonId).blur()
})
} else {
this.$modal.msgWarning('请选择至少一条数据导出')
document.getElementById(exportButtonId).blur()
return
}
}
......
......@@ -57,16 +57,18 @@
>新增药品
</el-button>
<el-button
id="all-choice"
v-hasPermi="['finance:drug:export']"
class="fourWordswhiteBtn"
@click="checkAll"
@click="checkAll('all-choice')"
><svg-icon style="margin-right: 1px" icon-class="shuaixuan_icon_quanbu" />
选择全部
</el-button>
<el-button
id="re-choice"
v-hasPermi="['finance:drug:export']"
class="fourWordswhiteBtn"
@click="reverseSelection"
@click="reverseSelection('re-choice')"
><svg-icon style="margin-right: 1px" icon-class="shuaixuan_icon_fanxiang" />反向选择
</el-button>
<el-button
......@@ -78,9 +80,10 @@
批量导入
</el-button>
<el-button
id="export-handle"
v-hasPermi="['finance:drug:export']"
class="fourWordswhiteBtn"
@click="handleExport"
@click="handleExport('export-handle')"
>
<svg-icon style="margin-right: 1px" icon-class="shaixuan_icon_daochu" />
批量导出
......@@ -760,10 +763,11 @@ export default {
// },
// 选择全部
checkAll() {
checkAll(allChoiceButtonId) {
this.ids = this.idsForever
// 调用手动勾选
this.manualCheck()
document.getElementById(allChoiceButtonId).blur()
},
// 手动勾选
manualCheck() {
......@@ -782,7 +786,7 @@ export default {
},
// 反向选择(把永久临时集合和变化的临时集合做减法重新赋给变化的临时集合赋给)
reverseSelection() {
reverseSelection(reChoice) {
const temp = []
this.idsForever.forEach(item => {
if (!this.ids.includes(item)) {
......@@ -792,6 +796,7 @@ export default {
this.ids = temp
console.log('反选的数据', this.ids)
this.manualCheck()
document.getElementById(reChoice).blur()
},
// 表格当前手动勾选的
selectChange(selection, row) {
......@@ -857,7 +862,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
handleExport(exportButtonId) {
console.log('this.ids', this.ids)
if (this.ids.length !== 0) {
const exportTable = {}
......@@ -866,9 +871,13 @@ export default {
this.download('finance/stock/drug/manage/export', exportTable, `药品库存-${this.exportFormatTime(new Date())}.xlsx`).then(res => {
this.$refs.table.clearSelection()
this.ids = []
}).finally(() => {
/* 最后给特定的id进行设置 */
document.getElementById(exportButtonId).blur()
})
} else {
this.$modal.msgWarning('请选择至少一条数据导出')
document.getElementById(exportButtonId).blur()
return
}
}
......
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