提交 315b0d76 编写于 作者: zhentian.jia's avatar zhentian.jia

对接新建项目中的选择范围接口 改小bug

上级 7baf82f9
......@@ -146,6 +146,7 @@ module.exports = {
GET(api, para, callback,str) {
// para.token = para.token || this.token || "343BCABC890349ACAF357FA79122F9FE"
let url = api + this.getUrlPara(para)
url = encodeURI(url);
return fetch({
url: getBaseUrl(url),
method: 'get',
......
......@@ -65,7 +65,7 @@
class="bg-img"
src="../../assets/image/small.png"
>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
<div class="limit-text">
<p>尺寸:48*48</p>
<p>限制大小: 500Kb</p>
......@@ -81,7 +81,6 @@
</el-form-item>
<el-form-item label="封面图片(视频):" prop="attachmentUrl2">
<el-upload
size="mini"
v-model="formData.attachmentUrl2"
class="bg-uploader"
action="#"
......@@ -94,7 +93,7 @@
class="bg-img"
src="../../assets/image/small.png"
>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
<div class="limit-text">
<p>尺寸:750*420</p>
<p>限制大小: 2.0 Mb</p>
......@@ -108,9 +107,12 @@
v-model="formData.attachmentUrl3"
class="upload-pdf"
action="#"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-upload="beforeUploadPDF"
:on-change="handleChange"
:before-remove="beforeRemove"
multiple
:limit="3"
:on-exceed="handleExceed"
:file-list="fileList"
>
......@@ -151,27 +153,35 @@
<el-tab-pane label="设定机构" name="second">
<el-form :inline="true" :model="formOrganization" class="demo-form-inline">
<el-form-item label>
<el-input v-model="formOrganization.name" placeholder="请输入机构名称"></el-input>
<el-input size="mini" v-model="formOrganization.name" placeholder="请输入机构名称"></el-input>
</el-form-item>
<el-form-item label>
<el-select v-model="formOrganization.region" placeholder="全部地区">
<el-option label="全部地区" value></el-option>
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<el-select size="mini" v-model="formOrganization.region" placeholder="全部地区">
<el-option
v-for="(item, index) in organizationRegion"
:key="index"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="formOrganization.grade" placeholder="全部医院级别">
<el-option label="全部医院级别" value></el-option>
<el-option label="三家" value="3"></el-option>
<el-option label="二甲" value="2"></el-option>
<el-option label="一甲" value="1"></el-option>
<el-select size="mini" v-model="formOrganization.grade" placeholder="全部医院级别">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="">搜索</el-button>
</el-form-item>
<el-form-item style="float:right;">
<el-button-group>
<el-button type @click="checkAll(true)">选择全部</el-button>
<el-button type @click="checkAll(false)">全部不选</el-button>
<el-button size="small" type="default" @click="checkAll(true,'multipleOrganization')">选择全部</el-button>
<el-button size="small" type="default" @click="checkAll(false,'multipleOrganization')">全部不选</el-button>
</el-button-group>
</el-form-item>
</el-form>
......@@ -185,30 +195,27 @@
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="医院名称"></el-table-column>
<el-table-column prop="grade" label="医院级别"></el-table-column>
<el-table-column prop="province" label="所属省份"></el-table-column>
<el-table-column prop="city" label="所属城市"></el-table-column>
<el-table-column prop="district" label="所属区县"></el-table-column>
<el-table-column prop="street" label="所属街道"></el-table-column>
<el-table-column prop="hospitalLevel" label="医院级别"></el-table-column>
<el-table-column prop="provinceName" label="所属省份"></el-table-column>
<el-table-column prop="cityName" label="所属城市"></el-table-column>
<el-table-column prop="countyName" label="所属区县"></el-table-column>
<el-table-column prop="townName" label="所属街道"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeOrganization"
@current-change="handleCurrentOrganization"
:current-page="currentOrganization"
:page-sizes="[2, 3, 4]"
:page-size="pageSizeOrganization"
layout="total, sizes, prev, pager, next, jumper"
:total="totalOrganization"
></el-pagination>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeOrganization"
@current-change="handleCurrentOrganization"
:current-page="formOrganization.pageNum"
:page-sizes="[10, 20, 40]"
:page-size="formOrganization.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalOrganization"
></el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="设定科室" name="third">
<el-col :span="8">
<el-select v-model="formDepartment.grade" placeholder="全部医院级别">
<el-option label="全部医院级别" value></el-option>
<el-option label="三家" value="3"></el-option>
<el-option label="二甲" value="2"></el-option>
<el-option label="一甲" value="1"></el-option>
</el-select>
<el-table
class="department"
ref="multipleDepartment"
......@@ -225,20 +232,34 @@
<el-tab-pane label="设定人员" name="fourth">
<el-form :inline="true" :model="formPersonnel" class="demo-form-inline">
<el-form-item label>
<el-select v-model="formPersonnel.hospital" placeholder="全部医院">
<el-option label="全部医院" value></el-option>
<el-option label="上海第一人民医院" value="shanghai"></el-option>
<el-option label="北京医院" value="beijing"></el-option>
<el-select size="mini" v-model="formPersonnel.hospital" placeholder="全部医院">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="formPersonnel.department" placeholder="全部部门">
<el-option label="全部部门" value></el-option>
<el-option label="内科" value="3"></el-option>
<el-option label="外科" value="2"></el-option>
<el-option label="心内科" value="1"></el-option>
<el-select size="mini" v-model="formPersonnel.department" placeholder="全部部门">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="getPeople">搜索</el-button>
</el-form-item>
<el-form-item style="float:right;">
<el-button-group>
<el-button size="small" type="default" @click="checkAll(true,'multiplePerson')">选择全部</el-button>
<el-button size="small" type="default" @click="checkAll(false,'multiplePerson')">全部不选</el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
class="rim"
......@@ -250,21 +271,24 @@
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="name" label="人员名称"></el-table-column>
<el-table-column prop="hospital" label="所属医院"></el-table-column>
<el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column prop="province" label="所属省份"></el-table-column>
<el-table-column prop="city" label="所属城市"></el-table-column>
<el-table-column prop="district" label="所属区县" show-overflow-tooltip></el-table-column>
<el-table-column prop="hospitalName" label="所属医院"></el-table-column>
<el-table-column prop="departmentName" label="所属部门"></el-table-column>
<el-table-column prop="provinceName" label="所属省份"></el-table-column>
<el-table-column prop="cityName" label="所属城市"></el-table-column>
<el-table-column prop="countyName" label="所属区县" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizePerson"
@current-change="handleCurrentPerson"
:current-page="currentPerson"
:page-sizes="[2, 3, 4]"
:page-size="pageSizePerson"
layout="total, sizes, prev, pager, next, jumper"
:total="totalPerson"
></el-pagination>
<div class="pagination">
<el-pagination
background
@size-change="handleSizePerson"
@current-change="handleCurrentPerson"
:current-page="formPersonnel.pageNum"
:page-sizes="[10, 20, 40]"
:page-size="formPersonnel.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalPerson"
></el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</div>
......@@ -312,7 +336,7 @@
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="formComponent.configure == 1" label="选择证书:" prop="certificate">
<el-form-item v-show="formComponent.configure == 1" label="选择证书:" >
<el-col :span="20">
<el-select
v-model="formComponent.certificate"
......@@ -383,14 +407,9 @@ export default {
attachmentUrl2: "",
attachmentUrl3: ""
},
fileList: [
{
name: "food.pdf",
url:
"https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg"
}
],
fileList: [],
//设定行政范围 数据
updatedTree: false,
treeProp: {
label: "name",
children: "zones",
......@@ -407,8 +426,24 @@ export default {
name: "",
region: "",
grade: "",
chechAll: true
chechAll: true,
pageNum: 1,
pageSize: 10,
},
organizationRegion: [{
id:'100',
label: '上海',
},{
id:'101',
label: '北京',
}],
organizationRank: [{
id:'1',
label: '一甲',
},{
id:'2',
label: '二甲',
}],
hasOrganizationInit: false,
//tableOrganization: Array(10).fill(itemOrganization),
tableOrganization: new Array(),
......@@ -420,28 +455,25 @@ export default {
formDepartment: {
grade: ""
},
tableDepartment: [
{ name: "全科" },
{ name: "内科" },
{ name: "外科" },
{ name: "心内科" },
{ name: "内分泌科" }
],
tableDepartment: [],
//设定人员 数据
formPersonnel: {
hospital: "",
department: ""
department: "",
pageNum: 1,
pageSize: 10,
},
tablePerson: new Array(),
currentPerson: 1,
pageSizePerson: 2,
totalPerson: 10,
//选择项目组件 数据
optionsComponent: [],
optionsCertificate: [],
formComponent: {
component: [],
configure: 1,
configure: 2,
certificate: ""
},
tagsComponent: [],
......@@ -514,8 +546,6 @@ export default {
vm = this;
this.editManager();
this.changeOnStep(this.active);
this.initOrganization();
this.initPerson();
this.$nextTick(function() {
this.getComponentInfo();
......@@ -544,6 +574,7 @@ export default {
//设置编辑数据
setEditData(editData) {
//console.log(editData);
//设置基础信息页
this.formData = {
id: vm.getUrlSearch(window.location.href, "projectId"),
projectName: editData.projectData.projectName,
......@@ -554,11 +585,31 @@ export default {
editData.projectData.projectBegintime
],
projectIntro: editData.projectData.projectIntro,
type: editData.attachmentModel[1].attachmentType,
attachmentUrl1: editData.attachmentModel[0].attachmentUrl,
attachmentUrl2: editData.attachmentModel[1].attachmentUrl,
type: editData.attachmentData[1].attachmentType,
attachmentUrl1: editData.attachmentData[0].attachmentUrl,
attachmentUrl2: editData.attachmentData[1].attachmentUrl,
attachmentUrl3: ""
};
if (editData.attachmentData.length > 2) {
for (let i = 2; i < editData.attachmentData.length; i++) {
let pdfItem = {
name: editData.attachmentData[i].attachmentName,
url: editData.attachmentData[i].attachmentUrl
};
vm.fileList.push(pdfItem);
}
}
//设置选择项目组件页
let componentEdit = [];
let certificateEdit = 0;
for(let i = 0;i<editData.componentData.length;i++) {
componentEdit.push(editData.componentData[i].id);
}
this.formComponent.component = componentEdit;
if(editData.certificateData.length > 0) {
this.formComponent.configure = 1;
this.formComponent.certificate = editData.componentData[0].id;
}
},
//编辑管理
editManager(data) {
......@@ -598,13 +649,18 @@ export default {
seqNo: 1
}
];
let attachmentPDFModel = [
{
let attachmentPDFModel = [];
// if (option == "add") {
for (let i = 0; i < vm.fileList.length; i++) {
let PDFModel = {
attachmentType: 3,
attachmentUrl: this.formData.attachmentUrl3,
attachmentName: vm.fileList[i].name,
attachmentUrl: vm.fileList[i].url,
kind: 3
}
];
};
attachmentPDFModel.push(PDFModel);
}
//}
if (option == "edit") {
//编辑
projectModel.id = this.formData.id;
......@@ -654,15 +710,27 @@ export default {
}
});
},
//项目组件信息 暂存/完成
componentDraft(type) {
let param = {
componentIds: this.formComponent.component,
certificateId: this.formComponent.certificate,
projectId: 9,
projectId: parseInt(vm.getUrlSearch(window.location.href, "projectId")),
type: type
};
vm.POST("portalInfo/componentDraft", param).then(res => {
console.log(res);
if(res.code == '000000') {
this.$notify({
title: "成功",
message: "项目创建成功"
});
} else {
this.$notify({
title: "",
message: res.message
});
}
});
},
//步骤style
......@@ -671,6 +739,7 @@ export default {
this.stepData = [true, false, false];
} else if (active == 1) {
this.stepData = [false, true, false];
this.initRange();
} else if (active == 2) {
this.stepData = [false, false, true];
}
......@@ -734,7 +803,8 @@ export default {
this.insertOrUpdate("add");
this.active++;
this.stepData = [false, true, false];
this.checkAllTable();
this.initRange();
//this.checkAllTable();
} else {
this.$message.error("项目名称" + res.message);
}
......@@ -744,8 +814,9 @@ export default {
this.insertOrUpdate("edit");
this.active++;
this.stepData = [false, true, false];
this.checkAllTable();
this.initRange();
}
}
} else if (this.active == 1) {
let removeState = true;
......@@ -790,6 +861,7 @@ export default {
//上传PDF
beforeUploadPDF(file) {
console.log(file);
console.log(this.fileList);
const isPDF = file.type === "application/pdf";
if (!isPDF) {
this.$message.error("请上传PDF格式文件!");
......@@ -803,10 +875,18 @@ export default {
1
).then(function(path) {
console.log(path);
let fileItem = {
name: path.name,
url: path.fullPath
};
vm.fileList.push(fileItem);
vm.$message.success("上传成功");
});
}
},
handleChange(file, fileList) {
//this.fileList3 = fileList.slice(-3);
},
//上传mp4
beforeUploadMp4(file) {},
//上传图片校验
......@@ -853,10 +933,15 @@ export default {
return isJPG && isLt2M;
},
handleRemove(file, fileList) {
console.log(file, fileList);
for (let i = 0; i < vm.fileList.length; i++) {
if (vm.fileList[i].name == file.name) {
vm.fileList.splice(i, 1);
console.log("删除" + i);
}
}
},
handlePreview(file) {
console.log(file);
//console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
......@@ -868,10 +953,45 @@ export default {
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
},
//第二步 选择范围 初始化
initRange() {
let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId == null) {
//新建
} else {
//编辑
this.getAdministrative();
}
},
//查询行政范围(树)
getAdministrative() {
let req = {
projectId: 1
};
vm.GET("scope/v1/administrative", req).then(res => {
if (res.code == "000000") {
//console.log(res.data);
let administrativeAll = res.data.administrativeAll;
console.log(administrativeAll);
this.treeData = []
this.treeData[0] = administrativeAll;
}
});
},
//切换tab
handleClick(tab, event) {
//console.log(tab);
let tabName = tab.name;
if(tabName == "second") {
//设定机构
this.getOrganization();
} else if(tabName == "third") {
//设定科室
} else if(tabName == "fourth") {
//设定人员
this.getPeople();
}
},
//列举选中地区
initCheckList(allSelectedKeys) {
this.tagsRegion = [];
......@@ -973,6 +1093,7 @@ export default {
console.log(treeKeyList);
this.$refs.tree.setCheckedKeys(treeKeyList);
},
//删除label节点 同步树结构
handleCloseTree(tag) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
......@@ -998,6 +1119,23 @@ export default {
//this.$refs[name].clearSelection();
}
},
//查询机构列表
getOrganization() {
let req = {
projectId: 1,
setKind:3,
scope: '000_110',
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize,
};
vm.GET("scope/v1/organization", req).then(res => {
if (res.code == "000000") {
console.log(res.data);
this.tableOrganization = res.data.organizationList;
this.$refs.multipleOrganization.toggleAllSelection();
}
});
},
//获取科室信息
getDepartment() {
let req = {
......@@ -1009,30 +1147,46 @@ export default {
}
});
},
//查询人员列表
getPeople() {
let req = {
projectId: 1,
setKindOfAdministrative: 3,
scopeOfAdministrative: '000_110',
setKindOfOrganization: 3,
scopeOfOrganization: '2|3|4|5|6|7',
setKindOfDepartment: 3,
scopeOfDepartment: 54,
pageNum: this.formPersonnel.pageNum,
pageSize: this.formPersonnel.pageSize,
};
vm.GET("scope/v1/people", req).then(res => {
if (res.code == "000000") {
console.log(res.code);
this.tablePerson = res.data.people;
this.totalPerson = res.data.total;
}
});
},
//机构table修改
handleSizeOrganization(val) {
console.log(`每页 ${val} 条`);
this.formOrganization.pageSize = val;
},
handleCurrentOrganization(val) {
console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val;
this.getOrganization();
},
//角色table修改
handleSizePerson(val) {
console.log(`每页 ${val} 条`);
this.formPersonnel.pageSize = val;
},
handleCurrentPerson(val) {
console.log(`当前页: ${val}`);
},
//初始化机构数据
initOrganization() {
//console.log(returnData());
let data = returnData().tableOrganization;
this.tableOrganization = data;
},
//初始化设定人员数据
initPerson() {
let data = returnData().tablePerson;
this.tablePerson = data;
this.formPersonnel.pageNum = val;
this.getPeople();
},
//行政范围改变更新设定机构和设定人员
updateOrganizationAndPerson(allSelectedKeys) {
......
......@@ -46,6 +46,7 @@ let tablePerson = [{
let treeData = [
{
id: 11,
name: "一级 1",
label: "一级 1",
children: [
{
......
......@@ -100,7 +100,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formInline.pageNo"
:page-sizes="[100, 200, 300, 400]"
:page-sizes="[10, 20, 30, 100]"
:page-size="formInline.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
......@@ -150,8 +150,8 @@ export default {
curmbFirst: "系统管理",
curmbSecond: "角色管理",
curmbThird: "项目角色",
tableData: Array(10).fill(item),
loading: false,
tableData: [],
loading: true,
timingTime: "",
totalRows: 0,
currentPage: 1,
......@@ -203,6 +203,7 @@ export default {
methods: {
//查询用户列表
queryRoleList() {
this.loading = true;
this.formInline.portalProjectId = vm.getUrlSearch(
window.location.href,
"portalProjectId"
......@@ -243,9 +244,12 @@ export default {
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formInline.pageSize = val;
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.formInline.pageNo = val;
this.queryRoleList();
},
//重置表单
resetForm() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册