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. 223
      src/views/modules/plugins/point/icpointnucleicmonitoring.vue
  4. 1
      src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue
  5. 178
      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() {
//

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

@ -6,48 +6,61 @@
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<!--<el-form-item label="所属组织名称" prop="orgName">-->
<!--<el-select v-model="dataForm.orgName" placeholder="所属组织名称">-->
<!--<el-option-->
<!--ref="org"-->
<!--v-for="item in organizationList"-->
<!--:key="item.orgId"-->
<!--:label="item.orgName"-->
<!--:value="item.orgId"-->
<!--&gt;-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="所属组织名称" prop="orgName" label-width="130px">
<el-cascader
ref="org"
v-model="orgIds"
:options="organizationList"
:props="{ checkStrictly: false, multiple: false, emitPath: true }"
style="width:200px"
clearable
@change="orgChangeHandle"
>
</el-cascader>
</el-form-item>
<!--<el-form-item label="所属组织名称" prop="orgName">-->
<!--<el-select v-model="dataForm.orgName" placeholder="所属组织名称">-->
<!--<el-option-->
<!--ref="org"-->
<!--v-for="item in organizationList"-->
<!--:key="item.orgId"-->
<!--:label="item.orgName"-->
<!--:value="item.orgId"-->
<!--&gt;-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="所属组织名称" prop="orgName" label-width="130px">
<el-cascader
ref="org"
v-model="orgIds"
:options="organizationList"
:props="{ checkStrictly: false, multiple: false, emitPath: true }"
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()">{{-->
<!--$t("deleteBatch")-->
<!--}}</el-button>-->
<!--<el-button type="danger" @click="deleteHandle()">{{-->
<!--$t("deleteBatch")-->
<!--}}</el-button>-->
<!--</el-form-item>-->
</el-form>
</div>
@ -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,50 +213,64 @@ export default {
dataForm: {
name: "",
mobile: "",
orgId: ""
orgId: "",
},
organizationList: [],
orgIds:[]
organizationList: [],
orgIds: [],
updateId: null,
};
},
components: {
AddOrUpdate,
},
created(){
this.getFormInfo()
},
created() {
this.getFormInfo();
},
methods: {
//
getFormInfo() {
this.$http
.post(`/gov/org/agency/getOrgTreeListByCustomerId`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.organizationList = res.data;
this.deleteChildren(this.organizationList)
})
.catch(() => {});
},
deleteChildren(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)
} else {
delete childs[i].children
}
}
}
return arr
},
orgChangeHandle () {
this.dataForm.orgId = this.orgIds[this.orgIds.length-1]
console.log(this.dataForm)
},
// /
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
.post(`/gov/org/agency/getOrgTreeListByCustomerId`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.organizationList = res.data;
this.deleteChildren(this.organizationList);
})
.catch(() => {});
},
deleteChildren(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);
} else {
delete childs[i].children;
}
}
}
return arr;
},
orgChangeHandle() {
this.dataForm.orgId = this.orgIds[this.orgIds.length - 1];
console.log(this.dataForm);
},
handleExportModule() {
let title = "核酸检测点模板";
let url = "/epmetuser/icPointNucleicMonitoring/exporttemplate";
@ -260,31 +288,30 @@ export default {
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
//
download(data, fileName) {
if (!data) {
return;
}
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
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");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload(file) {
this.files = 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();
},

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

@ -7,23 +7,36 @@
@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()">{{-->
<!--$t("deleteBatch")-->
<!--}}</el-button>-->
<!--<el-button type="danger" @click="deleteHandle()">{{-->
<!--$t("deleteBatch")-->
<!--}}</el-button>-->
<!--</el-form-item>-->
</el-form>
</div>
@ -77,10 +90,10 @@
width="50"
></el-table-column>
<!--<el-table-column-->
<!--prop="orgName"-->
<!--label="所属组织名称"-->
<!--header-align="center"-->
<!--align="center"-->
<!--prop="orgName"-->
<!--label="所属组织名称"-->
<!--header-align="center"-->
<!--align="center"-->
<!--&gt;</el-table-column>-->
<el-table-column
prop="name"
@ -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>
@ -201,15 +215,30 @@ export default {
deleteIsBatch: true,
},
dataForm: {
name: "",
mobile: ""
name: "",
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";
@ -227,31 +256,30 @@ export default {
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
//
download(data, fileName) {
if (!data) {
return;
}
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
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");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload(file) {
this.files = file;
@ -271,46 +299,48 @@ export default {
return true;
}
},
async uploadFile() {
if (this.fileName == "") {
this.$message.warning("请选择要上传的文件!");
return false;
}
this.$message({
showClose: true,
message: "导入中,请到系统管理-导入记录中查看进度",
duration: 0,
});
async uploadFile() {
if (this.fileName == "") {
this.$message.warning("请选择要上传的文件!");
return false;
}
//
this.$refs['upload'].clearFiles();
let url = "";
this.$message({
showClose: true,
message: "导入中,请到系统管理-导入记录中查看进度",
duration: 0,
});
let fileFormData = new FormData();
fileFormData.append("file", this.files); //filenamefiletest.zip
//
this.$refs["upload"].clearFiles();
let url = "";
url = "/epmetuser/icPointVaccinesInoculation/pointImport";
let fileFormData = new FormData();
fileFormData.append("file", this.files); //filenamefiletest.zip
window.app.ajax.post2(url,fileFormData,(data, rspMsg) => {
if (data.code === 0 && data.msg == "success") {
// this.$message.success('')
} else {
// this.$message({
// showClose: true,
// message: rspMsg,
// duration: 0,
// type: "error"
// })
// this.$message.error(rspMsg)
}
this.loadTable();
url = "/epmetuser/icPointVaccinesInoculation/pointImport";
},
(rspMsg, data) => {},
{ headers: { "Content-Type": "multipart/form-data" } }
);
}
window.app.ajax.post2(
url,
fileFormData,
(data, rspMsg) => {
if (data.code === 0 && data.msg == "success") {
// this.$message.success('')
} else {
// this.$message({
// showClose: true,
// message: rspMsg,
// duration: 0,
// type: "error"
// })
// this.$message.error(rspMsg)
}
this.loadTable();
},
(rspMsg, data) => {},
{ headers: { "Content-Type": "multipart/form-data" } }
);
},
},
};
</script>

Loading…
Cancel
Save