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.page = 1
this.query() this.query()
}, },
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) { 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-item>
</el-form> </el-form>
<div class="submit"> <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()">{{ <el-button type="primary" @click="dataFormSubmitHandle()">{{
$t("confirm") $t("confirm")
}}</el-button> }}</el-button>
@ -207,6 +207,9 @@ export default {
this.initMap(); this.initMap();
}, },
methods: { methods: {
closeSubmit(){
this.$emit('closeDialog')
},
// init // init
initMap() { initMap() {
// //

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

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

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

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

Loading…
Cancel
Save