Browse Source

删除增加提示,新增按钮防抖

360view
bianyaqi 2 years ago
parent
commit
7a58603a25
  1. 4
      public/index.html
  2. 20
      src/components/360View/medicalRecord/callMedical/index.vue
  3. 27
      src/components/360View/medicalRecord/index.vue
  4. 16
      src/components/360View/opticalFile/index.vue
  5. 32
      src/page-subspecialty/views/modules/optometryManagement/dioptric/patient-add-or-update.vue
  6. 32
      src/page-subspecialty/views/modules/outpatientManagement/call/patient-add-or-update.vue
  7. 38
      src/page-subspecialty/views/modules/outpatientManagement/treat/patient-add-or-update.vue

4
public/index.html

@ -39,8 +39,8 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script> <script>
//http://121.36.16.195:9002/huimu-admin/swagger-ui/index.html //http://121.36.16.195:9002/huimu-admin/swagger-ui/index.html
window.SITE_CONFIG['apiURL'] = 'http://47.110.224.240:8036/xiangan-crf';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.0.167:8036/xiangan-crf';
// window.SITE_CONFIG['apiURL'] = 'http://47.110.224.240:8036/xiangan-crf';
window.SITE_CONFIG['apiURL'] = 'http://192.168.0.167:8036/xiangan-crf';
</script> </script>
<% } %> <% } %>
<!-- 测试环境 --> <!-- 测试环境 -->

20
src/components/360View/medicalRecord/callMedical/index.vue

@ -122,18 +122,20 @@ export default {
this.$message.error(res.msg) this.$message.error(res.msg)
} }
}, },
async deleteForm(id) {
deleteForm(id) {
const params = { const params = {
id: id id: id
} }
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
this.id = ''
await this.getFormList()
} else {
this.$message.error(res.msg)
}
this.$confirmFun('你确定要删除吗?').then(async() => {
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
this.id = ''
await this.getFormList()
} else {
this.$message.error(res.msg)
}
})
}, },
async getFormList() { async getFormList() {
const { data: res } = await this.$http.get('/patient/view/getCases', { const { data: res } = await this.$http.get('/patient/view/getCases', {

27
src/components/360View/medicalRecord/index.vue

@ -138,7 +138,26 @@ export default {
if (this.curIndex === index) { if (this.curIndex === index) {
return return
} }
this.$confirmFun('是否保存数据,否则当前数据会丢弃!', '保存', '', '已取消保存数据!')
// 360
if (this.onlyRead) {
this.curIndex = index
this.id = item.id
this.name = item.name
this.caseId = item.id
this.jsonText = item.jsonText
return
}
this.confirmChange().finally(() => {
this.curIndex = index
this.id = item.id
this.name = item.name
this.caseId = item.id
this.jsonText = item.jsonText
})
},
//
confirmChange() {
return this.$confirmFun('是否保存数据,否则当前数据会丢弃!', '保存', '', '已取消保存数据!')
.then(() => { .then(() => {
this.$nextTick(() => { this.$nextTick(() => {
switch (this.name) { switch (this.name) {
@ -159,12 +178,6 @@ export default {
return return
} }
}) })
}).finally(() => {
this.curIndex = index
this.id = item.id
this.name = item.name
this.caseId = item.id
this.jsonText = item.jsonText
}) })
}, },
getPatientData() { getPatientData() {

16
src/components/360View/opticalFile/index.vue

@ -178,13 +178,15 @@ export default {
const params = { const params = {
id: this.id id: this.id
} }
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
this.getFormList(1)
} else {
this.$message.error(res.msg)
}
this.$confirmFun('你确定要删除吗?').then(async() => {
const { data: res } = await this.$http.post('/case/delete', params)
if (res.code === 0) {
this.$message.success('删除成功')
this.getFormList(1)
} else {
this.$message.error(res.msg)
}
})
}, },
async getFormList(type) { async getFormList(type) {
const { data: res } = await this.$http.get('/patient/view/getCases', { const { data: res } = await this.$http.get('/patient/view/getCases', {

32
src/page-subspecialty/views/modules/optometryManagement/dioptric/patient-add-or-update.vue

@ -83,7 +83,7 @@
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@ -103,6 +103,7 @@ export default {
}, },
data() { data() {
return { return {
disabled: false,
visible: false, visible: false,
dataForm: { dataForm: {
platform: 3, platform: 3,
@ -198,25 +199,30 @@ export default {
}, },
// //
dataFormSubmitHandle: debounce(function() { dataFormSubmitHandle: debounce(function() {
this.disabled = true
this.$refs.dataForm.validate((valid) => { this.$refs.dataForm.validate((valid) => {
if (!valid) { if (!valid) {
this.disabled = false
return false return false
} }
this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',') this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} }
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}) })
}).catch(() => {})
.catch(() => {})
.finally(() => { this.disabled = false })
}) })
}, 1000, { leading: true, trailing: false }), }, 1000, { leading: true, trailing: false }),
// //

32
src/page-subspecialty/views/modules/outpatientManagement/call/patient-add-or-update.vue

@ -83,7 +83,7 @@
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@ -104,6 +104,7 @@ export default {
}, },
data() { data() {
return { return {
disabled: false,
visible: false, visible: false,
dataForm: { dataForm: {
platform: 1, platform: 1,
@ -207,25 +208,30 @@ export default {
}, },
// //
dataFormSubmitHandle: debounce(function() { dataFormSubmitHandle: debounce(function() {
this.disabled = true
this.$refs.dataForm.validate((valid) => { this.$refs.dataForm.validate((valid) => {
if (!valid) { if (!valid) {
this.disabled = false
return false return false
} }
this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',') this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} }
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}) })
}).catch(() => {})
.catch(() => {})
.finally(() => { this.disabled = false })
}) })
}, 1000, { leading: true, trailing: false }), }, 1000, { leading: true, trailing: false }),
// //

38
src/page-subspecialty/views/modules/outpatientManagement/treat/patient-add-or-update.vue

@ -80,7 +80,7 @@
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@ -100,6 +100,7 @@ export default {
}, },
data() { data() {
return { return {
disabled: false,
visible: false, visible: false,
dataForm: { dataForm: {
platform: 2, platform: 2,
@ -194,27 +195,34 @@ export default {
}, },
// //
dataFormSubmitHandle: debounce(function() { dataFormSubmitHandle: debounce(function() {
this.disabled = true
this.$refs.dataForm.validate((valid) => { this.$refs.dataForm.validate((valid) => {
if (!valid) { if (!valid) {
this.disabled = false
return false return false
} }
this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',') this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} }
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
})
.catch(res => {
this.$message.error(res.msg)
})
.finally(() => {
this.disabled = false
}) })
}).catch(res => {
this.$message.error(res.msg)
})
}) })
}, 1000, { leading: true, trailing: false }), }, 1000, { leading: true, trailing: false }),
// //

Loading…
Cancel
Save