Browse Source

fsfds2

shibei_master
dai 3 years ago
parent
commit
6a5daf8c6a
  1. 370
      src/views/modules/communityService/dqfwzx/cpts/edit.vue
  2. 2
      src/views/modules/communityService/dqfwzx/index.vue

370
src/views/modules/communityService/dqfwzx/cpts/edit.vue

@ -1,227 +1,282 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="中心名称 "
prop="centerName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入中心名称 "
v-model="dataForm.centerName">
<el-form
ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="中心名称 "
prop="centerName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入中心名称 "
v-model="dataForm.centerName"
>
</el-input>
</el-form-item>
<el-form-item label="办公电话"
prop="workPhone"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入办公电话"
v-model="dataForm.workPhone">
<el-form-item
label="办公电话"
prop="workPhone"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入办公电话"
v-model="dataForm.workPhone"
>
</el-input>
</el-form-item>
<el-form-item label="社区地址"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入社区地址 "
v-model="dataForm.address">
<el-form-item
label="社区地址"
prop="address"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入社区地址 "
v-model="dataForm.address"
>
</el-input>
</el-form-item>
<el-form-item label="办公时间"
prop="amStartTime"
label-width="150px"
style="display: block">
<el-form-item
label="办公时间"
prop="amStartTime"
label-width="150px"
style="display: block"
>
<div class="row">
<span>上午</span>
<el-time-select style="margin-left: 10px"
v-model="dataForm.amStartTime"
:picker-options="{
<el-time-select
style="margin-left: 10px"
v-model="dataForm.amStartTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '12:00',
}"
placeholder="开始时间">
placeholder="开始时间"
>
</el-time-select>
<span style="margin: 0 5px"></span>
<el-time-select v-model="dataForm.amEndTime"
:picker-options="{
<el-time-select
v-model="dataForm.amEndTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '12:00',
minTime: dataForm.amStartTime,
}"
placeholder="结束时间">
placeholder="结束时间"
>
</el-time-select>
</div>
<div class="row"
style="margin-top: 5px">
<div class="row" style="margin-top: 5px">
<span>下午</span>
<el-time-select style="margin-left: 10px"
v-model="dataForm.pmStartTime"
:picker-options="{
<el-time-select
style="margin-left: 10px"
v-model="dataForm.pmStartTime"
:picker-options="{
start: '12:00',
step: '00:30',
end: '24:00',
}"
placeholder="开始时间">
placeholder="开始时间"
>
</el-time-select>
<span style="margin: 0 5px"></span>
<el-time-select v-model="dataForm.pmEndTime"
:picker-options="{
<el-time-select
v-model="dataForm.pmEndTime"
:picker-options="{
start: '12:00',
step: '00:30',
end: '24:00',
minTime: dataForm.pmStartTime,
}"
placeholder="结束时间">
placeholder="结束时间"
>
</el-time-select>
</div>
</el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<div style="width: 500px">
<el-input class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.locationAddress">
<el-input
class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.locationAddress"
>
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
class="div_map"></div>
<el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude"
>
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude"
>
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="可预约事项"
prop="matterList"
label-width="150px"
style="display: block">
<el-form-item
label="可预约事项"
prop="matterList"
label-width="150px"
style="display: block"
>
<div class="m-staffs">
<div class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.matterList">
<div
class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.matterList"
>
<div class="item-info">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="事项名"
v-model="item.matterName"
:disabled="item.matterId != undefined" />
<el-select style="margin-left: 10px"
v-model="item.appointmentType"
filterable
placeholder="预约类型"
:disabled="item.matterId != undefined">
<el-option v-for="item in appointmentTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="事项名"
v-model="item.matterName"
:disabled="item.matterId != undefined"
/>
<el-select
style="margin-left: 10px"
v-model="item.appointmentType"
filterable
placeholder="预约类型"
:disabled="item.matterId != undefined"
>
<el-option
v-for="item in appointmentTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-time-select style="margin-left: 10px"
v-model="item.startTime"
:picker-options="{
<el-time-select
style="margin-left: 10px"
v-model="item.startTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '24:00',
}"
placeholder="开始时间"
:disabled="item.matterId != undefined">
placeholder="开始时间"
:disabled="item.matterId != undefined"
>
</el-time-select>
<span style="margin: 0 5px"></span>
<el-time-select v-model="item.endTime"
:picker-options="{
<el-time-select
v-model="item.endTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '24:00',
minTime: item.startTime,
}"
placeholder="结束时间"
:disabled="item.matterId != undefined">
placeholder="结束时间"
:disabled="item.matterId != undefined"
>
</el-time-select>
</div>
<div class="item-pic">
<el-upload :disabled="item.matterId != undefined"
class="avatar-uploader"
:action="uploadUlr"
:data="{ customerId: customerId }"
:show-file-list="false"
:on-success="
<el-upload
:disabled="item.matterId != undefined"
class="avatar-uploader"
:action="uploadUlr"
:data="{ customerId: customerId }"
:show-file-list="false"
:on-success="
(response, file, fileList) =>
handleImgSuccess(index, response, file, fileList)
"
:before-upload="beforeImgUpload">
<img v-if="item.matterImg"
:src="item.matterImg"
style="width: 50px; height: 50px"
class="function-icon" />
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
:before-upload="beforeImgUpload"
>
<img
v-if="item.matterImg"
:src="item.matterImg"
style="width: 50px; height: 50px"
class="function-icon"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div class="hint">事项封面图片小于1M</div>
<el-button style="margin-left: auto"
size="small"
@click="handleDelStaff(index)">删除</el-button>
<el-button
style="margin-left: auto"
size="small"
@click="handleDelStaff(index)"
>删除</el-button
>
</div>
</div>
<div class="item-add">
<el-button size="small"
type="warning"
@click="handleAddStaff">添加</el-button>
<el-button size="small" type="warning" @click="handleAddStaff"
>添加</el-button
>
</div>
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
<el-button size="small" @click="handleCancle"> </el-button>
<el-button
size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
</div>
</div>
</template>
@ -238,7 +293,7 @@ var infoWindowList;
let loading; //
export default {
data () {
data() {
return {
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2",
customerId: "",
@ -282,7 +337,7 @@ export default {
},
components: {},
computed: {
dataRule () {
dataRule() {
return {
centerName: [
{ required: true, message: "中心名称 不能为空", trigger: "blur" },
@ -318,13 +373,13 @@ export default {
props: {},
watch: {},
async mounted () {
async mounted() {
this.customerId = localStorage.getItem("customerId");
this.initMap();
},
methods: {
handleImgSuccess (index, res, file) {
handleImgSuccess(index, res, file) {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.dataForm.matterList[index].matterImg = res.data.url;
@ -333,7 +388,7 @@ export default {
}
},
beforeImgUpload (file) {
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 1;
if (!isLt1M) {
@ -342,7 +397,7 @@ export default {
return isLt1M;
},
handleAddStaff () {
handleAddStaff() {
this.dataForm.matterList = [
...this.dataForm.matterList,
{
@ -354,7 +409,7 @@ export default {
},
];
},
async handleDelStaff (index) {
async handleDelStaff(index) {
const { matterList } = this.dataForm;
let list = [...matterList];
let delItem = list.splice(index, 1);
@ -371,7 +426,7 @@ export default {
this.dataForm.matterList = list;
},
async delStaff (matterId) {
async delStaff(matterId) {
const { data, code, msg } = await requestPost(
"/gov/org/icpartyservicecenter/delmatter",
{
@ -381,7 +436,7 @@ export default {
return code === 0;
},
// init
initMap () {
initMap() {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map()
@ -407,7 +462,7 @@ export default {
this.handleMoveCenter();
},
setMarker (lat, lng) {
setMarker(lat, lng) {
markers.setGeometries([]);
markers.add([
{
@ -421,7 +476,7 @@ export default {
]);
},
handleSearchMap () {
handleSearchMap() {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
@ -449,7 +504,7 @@ export default {
});
},
handleMoveCenter () {
handleMoveCenter() {
//
const center = map.getCenter();
const lat = center.getLat();
@ -459,7 +514,7 @@ export default {
this.setMarker(lat, lng);
},
async initForm (type, row) {
async initForm(type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
@ -471,7 +526,7 @@ export default {
}
},
async handleComfirm () {
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
@ -486,7 +541,7 @@ export default {
});
},
async submit () {
async submit() {
let url = "";
if (this.formType === "add") {
url = "/gov/org/icpartyservicecenter/addpartyservicecenter";
@ -535,11 +590,11 @@ export default {
}
},
handleCancle () {
handleCancle() {
this.resetData();
this.$emit("dialogCancle");
},
resetData () {
resetData() {
this.partyServiceCenterId = "";
this.dataForm = {
centerName: "",
@ -557,7 +612,7 @@ export default {
};
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -565,7 +620,7 @@ export default {
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
@ -575,23 +630,28 @@ export default {
};
</script>
<style lang="scss" scoped >
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.m-staffs {
margin-left: auto;
width: 650px;
width: 950px;
.item {
display: flex;
.item-info {
display: flex;
margin: 0 20px;
width: 65%;
justify-content: space-around;
align-items: center;
margin-bottom: 7px;
}
.item-pic {
display: flex;
width: 35%;
align-items: center;
.hint {
font-size: 14px;
@ -630,5 +690,3 @@ export default {
}
}
</style>

2
src/views/modules/communityService/dqfwzx/index.vue

@ -106,7 +106,7 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
width="1150px"
top="5vh"
class="dialog-h"
@closed="handleClose"

Loading…
Cancel
Save