29187
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "addLinkage",
|
||||
appName: "添加联动记录",
|
||||
appName: "添加联动记录", // :"修改联动记录"
|
||||
data() {
|
||||
return {
|
||||
params: {
|
||||
@@ -48,17 +48,37 @@ export default {
|
||||
linksageDate: '',
|
||||
description: '',
|
||||
},
|
||||
userList: []
|
||||
userList: [],
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$dict.load('agriculturalType')
|
||||
this.getUserList()
|
||||
},
|
||||
onLoad(o) {
|
||||
if (o?.id) {
|
||||
this.id = o.id
|
||||
this.getDetail()
|
||||
this.form = JSON.parse(JSON.stringify(this.data))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDateChange(e) {
|
||||
this.form.linksageDate = `${e.year}-${e.month}-${e.day}`
|
||||
},
|
||||
getDetail() {
|
||||
this.$instance.post('/app/apppartyfourlinkage/queryDetailById',null,{
|
||||
params: {
|
||||
id: this.id,
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
// this.data = res.data
|
||||
this.form = JSON.parse(JSON.stringify(res.data))
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserList() {
|
||||
this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => {
|
||||
if(res?.data) {
|
||||
@@ -71,6 +91,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if(!this.form.residentId) {
|
||||
return this.$u.toast('请选择四邻对象')
|
||||
@@ -83,14 +104,23 @@ export default {
|
||||
}
|
||||
|
||||
this.$instance.post('/app/apppartyfourlinkage/addByWxApplet',{
|
||||
...this.form
|
||||
...this.form,
|
||||
id: this.id || '',
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.$u.toast('添加联动记录成功')
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('update')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},600)
|
||||
if (!this.id) {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},600)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
},600)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<div class="delBtn" @click="delBtn">删除联动记录</div>
|
||||
<div class="delBtn" @click="delBtn" v-if="data.status==1">删除联动记录</div>
|
||||
<div class="editBtn" @click="$linkTo(`./addLinkage?id=${id}`)" v-else>修改联动记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -116,7 +117,8 @@ export default {
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
background: #F3F6F9;
|
||||
.delBtn {
|
||||
.delBtn,
|
||||
.editBtn {
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
text-align: center;
|
||||
@@ -124,6 +126,11 @@ export default {
|
||||
border: 1px solid #FF4466;
|
||||
border-radius: 16px;
|
||||
}
|
||||
.editBtn {
|
||||
background: #4181FF !important;
|
||||
color: #FFF;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user