Browse Source

feat:添加部分事件

master
123456 3 years ago
parent
commit
5f9f601ab3
  1. 8
      src/mixins/view-module.js
  2. 5
      src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue
  3. 89
      src/views/modules/plugins/point/icpointnucleicmonitoring.vue
  4. 1
      src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue
  5. 66
      src/views/modules/plugins/point/icpointvaccinesinoculation.vue

8
src/mixins/view-module.js

@ -102,14 +102,6 @@ export default {
this.page = 1
this.query()
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
},
// 删除
deleteHandle (id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {

5
src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue

@ -96,7 +96,7 @@
</el-form-item>
</el-form>
<div class="submit">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button @click="closeSubmit">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{
$t("confirm")
}}</el-button>
@ -207,6 +207,9 @@ export default {
this.initMap();
},
methods: {
closeSubmit(){
this.$emit('closeDialog')
},
// init
initMap() {
//

89
src/views/modules/plugins/point/icpointnucleicmonitoring.vue

@ -24,25 +24,38 @@
v-model="orgIds"
:options="organizationList"
:props="{ checkStrictly: false, multiple: false, emitPath: true }"
style="width:200px"
style="width: 200px"
clearable
@change="orgChangeHandle"
>
</el-cascader>
</el-form-item>
<el-form-item label="核酸检测点名称" prop="name">
<el-input v-model="dataForm.name" placeholder="核酸检测点名称" clearable></el-input>
<el-input
v-model="dataForm.name"
placeholder="核酸检测点名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="咨询电话" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="咨询电话" clearable></el-input>
<el-input
v-model="dataForm.mobile"
placeholder="咨询电话"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button class="diy-button--search" @click="getDataList()">{{ $t("query") }}</el-button>
<el-button class="diy-button--search" @click="getDataList()">{{
$t("query")
}}</el-button>
</el-form-item>
<el-form-item>
<el-button class="diy-button--add" type="primary" @click="addOrUpdateHandle()">{{
$t("add")
}}</el-button>
<el-button
class="diy-button--add"
type="primary"
@click="addOrUpdateHandle()"
>{{ $t("add") }}</el-button
>
</el-form-item>
<!--<el-form-item>-->
<!--<el-button type="danger" @click="deleteHandle()">{{-->
@ -168,7 +181,7 @@
<!-- 弹窗, 新增 / 修改 -->
<el-dialog
:visible.sync="addOrUpdateVisible"
:title="!dataForm.id ? $t('add') : $t('update')"
:title="!updateId ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
:destroy-on-close="true"
@ -177,6 +190,7 @@
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
@closeDialog="closeDialog"
></add-or-update>
</el-dialog>
</div>
@ -199,19 +213,34 @@ export default {
dataForm: {
name: "",
mobile: "",
orgId: ""
orgId: "",
},
organizationList: [],
orgIds:[]
orgIds: [],
updateId: null,
};
},
components: {
AddOrUpdate,
},
created(){
this.getFormInfo()
created() {
this.getFormInfo();
},
methods: {
// /
addOrUpdateHandle(id) {
this.updateId = id;
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id;
this.$refs.addOrUpdate.init();
});
this.addOrUpdateVisible = true;
},
//
closeDialog() {
this.addOrUpdateVisible = false;
this.uploadId = null;
},
//
getFormInfo() {
this.$http
@ -221,27 +250,26 @@ export default {
return this.$message.error(res.msg);
}
this.organizationList = res.data;
this.deleteChildren(this.organizationList)
this.deleteChildren(this.organizationList);
})
.catch(() => {});
},
deleteChildren(arr) {
let childs = arr
let childs = arr;
for (let i = childs.length; i--; i > 0) {
if (childs[i].children) {
if (childs[i].children.length) {
this.deleteChildren(childs[i].children)
this.deleteChildren(childs[i].children);
} else {
delete childs[i].children
delete childs[i].children;
}
}
}
return arr
return arr;
},
orgChangeHandle () {
this.dataForm.orgId = this.orgIds[this.orgIds.length-1]
console.log(this.dataForm)
orgChangeHandle() {
this.dataForm.orgId = this.orgIds[this.orgIds.length - 1];
console.log(this.dataForm);
},
handleExportModule() {
let title = "核酸检测点模板";
@ -261,21 +289,21 @@ export default {
);
},
//
download (data, fileName) {
download(data, fileName) {
if (!data) {
return
return;
}
var csvData = new Blob([data])
var csvData = new Blob([data]);
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
var a = document.createElement("a");
document.body.appendChild(a);
a.style = 'display: none';
a.style = "display: none";
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
@ -283,7 +311,6 @@ export default {
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload(file) {
@ -317,7 +344,7 @@ export default {
});
//
this.$refs['upload'].clearFiles();
this.$refs["upload"].clearFiles();
let url = "";
let fileFormData = new FormData();
@ -325,7 +352,10 @@ export default {
url = "/epmetuser/icPointNucleicMonitoring/pointImport";
window.app.ajax.post2(url,fileFormData,(data, rspMsg) => {
window.app.ajax.post2(
url,
fileFormData,
(data, rspMsg) => {
if (data.code === 0 && data.msg == "success") {
// this.$message.success('')
} else {
@ -338,7 +368,6 @@ export default {
// this.$message.error(rspMsg)
}
this.loadTable();
},
(rspMsg, data) => {},
{ headers: { "Content-Type": "multipart/form-data" } }

1
src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue

@ -253,7 +253,6 @@ export default {
},
},
mounted() {
console.log(document.getElementById("map_app"));
this.getFormInfo();
this.initMap();
},

66
src/views/modules/plugins/point/icpointvaccinesinoculation.vue

@ -7,18 +7,31 @@
@keyup.enter.native="getDataList()"
>
<el-form-item label="疫苗接种点名称" prop="name">
<el-input v-model="dataForm.name" placeholder="核酸检测点名称" clearable></el-input>
<el-input
v-model="dataForm.name"
placeholder="核酸检测点名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="咨询电话" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="咨询电话" clearable></el-input>
<el-input
v-model="dataForm.mobile"
placeholder="咨询电话"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button class="diy-button--search" @click="getDataList()">{{ $t("query") }}</el-button>
<el-button class="diy-button--search" @click="getDataList()">{{
$t("query")
}}</el-button>
</el-form-item>
<el-form-item>
<el-button class="diy-button--add" type="primary" @click="addOrUpdateHandle()">{{
$t("add")
}}</el-button>
<el-button
class="diy-button--add"
type="primary"
@click="addOrUpdateHandle()"
>{{ $t("add") }}</el-button
>
</el-form-item>
<!--<el-form-item>-->
<!--<el-button type="danger" @click="deleteHandle()">{{-->
@ -173,7 +186,7 @@
<!-- 弹窗, 新增 / 修改 -->
<el-dialog
:visible.sync="addOrUpdateVisible"
:title="!dataForm.id ? $t('add') : $t('update')"
:title="!updateId ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
:destroy-on-close="true"
@ -181,6 +194,7 @@
<add-or-update
ref="addOrUpdate"
@refreshDataList="getDataList"
@closeDialog="closeDialog"
></add-or-update>
</el-dialog>
</div>
@ -202,14 +216,29 @@ export default {
},
dataForm: {
name: "",
mobile: ""
mobile: "",
},
updateId: null,
};
},
components: {
AddOrUpdate,
},
methods: {
// /
addOrUpdateHandle(id) {
this.updateId = id;
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id;
this.$refs.addOrUpdate.init();
});
this.addOrUpdateVisible = true;
},
//
closeDialog() {
this.addOrUpdateVisible = false;
this.uploadId = null;
},
handleExportModule() {
let title = "疫苗接种点模板";
let url = "/epmetuser/icPointVaccinesInoculation/exporttemplate";
@ -228,21 +257,21 @@ export default {
);
},
//
download (data, fileName) {
download(data, fileName) {
if (!data) {
return
return;
}
var csvData = new Blob([data])
var csvData = new Blob([data]);
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
var a = document.createElement("a");
document.body.appendChild(a);
a.style = 'display: none';
a.style = "display: none";
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
@ -250,7 +279,6 @@ export default {
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload(file) {
@ -284,7 +312,7 @@ export default {
});
//
this.$refs['upload'].clearFiles();
this.$refs["upload"].clearFiles();
let url = "";
let fileFormData = new FormData();
@ -292,7 +320,10 @@ export default {
url = "/epmetuser/icPointVaccinesInoculation/pointImport";
window.app.ajax.post2(url,fileFormData,(data, rspMsg) => {
window.app.ajax.post2(
url,
fileFormData,
(data, rspMsg) => {
if (data.code === 0 && data.msg == "success") {
// this.$message.success('')
} else {
@ -305,12 +336,11 @@ export default {
// this.$message.error(rspMsg)
}
this.loadTable();
},
(rspMsg, data) => {},
{ headers: { "Content-Type": "multipart/form-data" } }
);
}
},
},
};
</script>

Loading…
Cancel
Save