refactor(src/views/reagent/warehousing): 新增试剂模板添加节流功能

duizhaopin_ui
duan 2 years ago
parent fbff08cc9c
commit 606c99de61

@ -118,7 +118,7 @@
</div> </div>
</template> </template>
<script> <script>
import { throttle } from '@/utils'
export default { export default {
name: 'ReagentForm', name: 'ReagentForm',
// title dialog title // title dialog title
@ -178,7 +178,7 @@ export default {
} }
}, },
methods: { methods: {
handleConfirm() { handleConfirm: throttle(function() {
this.$refs['elForm'].validate(valid => { this.$refs['elForm'].validate(valid => {
if (valid) { if (valid) {
// //
@ -197,7 +197,7 @@ export default {
} }
if (!valid) return if (!valid) return
}) })
}, }, 2000),
// //
strToDate(datestr) { strToDate(datestr) {
return new Date(datestr) return new Date(datestr)

@ -224,7 +224,7 @@ import Scanner from '@/components/Scannner/index'
import { show_tmp, select_drug, bind_tmp_enter_warehouse, add_tmp, del_tmp } from '@/api/reagent/warehousing' import { show_tmp, select_drug, bind_tmp_enter_warehouse, add_tmp, del_tmp } from '@/api/reagent/warehousing'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients' import { getClients } from '@/views/reagent/mixin/getClients'
import { throttle } from '@/utils'
export default { export default {
name: 'Warehousing', name: 'Warehousing',
components: { ReagentForm, Scanner }, components: { ReagentForm, Scanner },
@ -446,7 +446,7 @@ export default {
this.reagentAddClient = null this.reagentAddClient = null
this.reagentAddTmpData = [] this.reagentAddTmpData = []
}, },
handleAddSave() { handleAddSave: throttle(function() {
if (!this.reagentAddTmpName) { if (!this.reagentAddTmpName) {
this.$message.warning('请输入模板名称!') this.$message.warning('请输入模板名称!')
return return
@ -467,7 +467,7 @@ export default {
} }
} }
) )
}, }, 2000),
// //
handleADDOpen(t) { handleADDOpen(t) {
if (t === 'add') { if (t === 'add') {

Loading…
Cancel
Save