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

药品bug

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