网格员
This commit is contained in:
83
packages/2.0.5/AppGridMember/components/add.vue
vendored
83
packages/2.0.5/AppGridMember/components/add.vue
vendored
@@ -117,15 +117,34 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<template v-if="editTwo==true">
|
<template v-if="editTwo==true">
|
||||||
<el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;">
|
<el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;">
|
||||||
<el-tag
|
<!-- <el-tag
|
||||||
:key="index"
|
:key="index"
|
||||||
v-for="(tag,index) in forms.girdInfoList"
|
v-for="(tag,index) in forms.girdInfoList"
|
||||||
closable
|
closable
|
||||||
:disable-transitions="false"
|
:disable-transitions="false"
|
||||||
@close="handleClose(tag)">
|
@close="handleClose(tag)">
|
||||||
{{tag.girdName}}
|
{{tag.girdName}}
|
||||||
</el-tag>
|
</el-tag> -->
|
||||||
<el-button size="small" @click="showGrid=true">选择网格</el-button>
|
<el-form-item style="width: 100%" label-width="80px" :label="'网格' + (index + 1)" v-for="(item, index) in forms.girdInfoList" :key="'选项' + (index + 1)">
|
||||||
|
<div class="form-flex">
|
||||||
|
<el-select v-model="item.checkType" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-input disabled v-model="item.girdName" :maxlength="200" size="small" placeholder="请输入选项">
|
||||||
|
<template slot="append">
|
||||||
|
<el-button size="small" @click="currIndex = index, showGrid = true">选择网格</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
<el-button type="danger" size="small" @click="removeGrid(index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="primary" size="small" @click="addGrid">添加选项</el-button>
|
||||||
|
<!-- <el-button size="small" @click="showGrid=true">选择网格</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="above">
|
<div class="above">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
@@ -221,6 +240,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
users: [],
|
users: [],
|
||||||
|
currIndex: 0,
|
||||||
forms: {
|
forms: {
|
||||||
birthday: "",
|
birthday: "",
|
||||||
education: "",
|
education: "",
|
||||||
@@ -240,6 +260,13 @@ export default {
|
|||||||
sex: "",
|
sex: "",
|
||||||
userId: "",
|
userId: "",
|
||||||
},
|
},
|
||||||
|
options: [{
|
||||||
|
value: '2',
|
||||||
|
label: '网格管理员'
|
||||||
|
}, {
|
||||||
|
value: '1',
|
||||||
|
label: '网格员'
|
||||||
|
}],
|
||||||
showGrid: false,
|
showGrid: false,
|
||||||
treeObj: {
|
treeObj: {
|
||||||
treeList: [],
|
treeList: [],
|
||||||
@@ -330,6 +357,18 @@ export default {
|
|||||||
isRefresh: !!isRefresh,
|
isRefresh: !!isRefresh,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
removeGrid (index) {
|
||||||
|
this.forms.girdInfoList.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
addGrid () {
|
||||||
|
this.forms.girdInfoList.push({
|
||||||
|
id: '',
|
||||||
|
girdName: '',
|
||||||
|
checkType: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
photoChange(val) {
|
photoChange(val) {
|
||||||
this.forms.photo = val[0].url;
|
this.forms.photo = val[0].url;
|
||||||
},
|
},
|
||||||
@@ -339,7 +378,17 @@ export default {
|
|||||||
this.forms.userId = val[0].sysUserId
|
this.forms.userId = val[0].sysUserId
|
||||||
},
|
},
|
||||||
getCheckedTree() {
|
getCheckedTree() {
|
||||||
this.forms.girdInfoList = this.$refs.tree.getCheckedNodes();
|
if (!this.$refs.tree.getCheckedNodes().length) {
|
||||||
|
return this.$message.error('请选择网格')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$refs.tree.getCheckedNodes().length > 1) {
|
||||||
|
return this.$message.error('不支持多选')
|
||||||
|
}
|
||||||
|
this.$set(this.forms.girdInfoList, this.currIndex, {
|
||||||
|
...this.$refs.tree.getCheckedNodes()[0],
|
||||||
|
checkType: this.forms.girdInfoList[this.currIndex].checkType
|
||||||
|
})
|
||||||
this.showGrid = false;
|
this.showGrid = false;
|
||||||
},
|
},
|
||||||
handleClose(tag) {
|
handleClose(tag) {
|
||||||
@@ -359,6 +408,15 @@ export default {
|
|||||||
save() {
|
save() {
|
||||||
this.$refs["rules"].validate((valid) => {
|
this.$refs["rules"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
for (let i = 0; i < this.forms.girdInfoList.length; i++) {
|
||||||
|
if (!this.forms.girdInfoList[i].checkType) {
|
||||||
|
return this.$message.error('请选择网格员类型')
|
||||||
|
}
|
||||||
|
if (!this.forms.girdInfoList[i].id) {
|
||||||
|
return this.$message.error('请选择网格')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.instance
|
this.instance
|
||||||
.post(
|
.post(
|
||||||
`/app/appgirdmemberinfo/addOrUpdate`,
|
`/app/appgirdmemberinfo/addOrUpdate`,
|
||||||
@@ -408,6 +466,23 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.add {
|
.add {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
.form-flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > .el-button {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
width: 300px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-form-item__content {
|
||||||
|
margin-left: 0!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
.ai-detail__title {
|
.ai-detail__title {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,17 +117,16 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "name",
|
prop: "name",
|
||||||
align: "center",
|
|
||||||
label: "网格员姓名",
|
label: "网格员姓名",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "girdInfoListStr",
|
prop: "girdInfoListStr",
|
||||||
align: "left",
|
align: "center",
|
||||||
label: "责任网格",
|
label: "责任网格",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "phone",
|
prop: "phone",
|
||||||
align: "left",
|
align: "center",
|
||||||
label: "联系电话",
|
label: "联系电话",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user