Parcourir la source

帮扶活动去掉disabled

“hanlingqiang il y a 1 an
Parent
commit
1fa31e088f

+ 228 - 130
src/views/weibao/views/loveHelp/details.vue

@@ -1,12 +1,24 @@
 <template>
   <div>
-    <van-nav-bar title="帮扶活动" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
+    <van-nav-bar
+      title="帮扶活动"
+      @click-left="$router.back()"
+      left-arrow
+      fixed
+      placeholder
+      safe-area-inset-top
+    />
     <van-form @submit="lovingHelpSave">
       <div class="main">
         <van-row class="cell">
           <van-col span="6">活动名称:</van-col>
           <van-col span="18">
-            <van-field v-model="form.name" :rules="[{ required: true}]" placeholder="活动名称" :disabled="id!=undefined" />
+            <van-field
+              v-model="form.name"
+              :rules="[{ required: true }]"
+              placeholder="活动名称"
+              :disabled="id != undefined"
+            />
           </van-col>
         </van-row>
 
@@ -14,27 +26,56 @@
           <van-col span="6">活动时间:</van-col>
           <van-col span="18" @click="clickdateshow">
             <!-- {{form.workDate?form.workDate:'请选择'}} -->
-            <van-field v-model="form.workDate" :rules="[{ required: true}]" placeholder="请选择" disabled />
+            <van-field
+              v-model="form.workDate"
+              :rules="[{ required: true }]"
+              placeholder="请选择"
+            />
           </van-col>
           <van-popup v-model="dateshow" position="bottom" :style="{ height: '50%' }">
-            <van-datetime-picker @confirm="dateConfirm" @cancel="dateshow=false" v-model="workDate" type="date" :min-date="minDate" :max-date="maxDate" :columns-order="[ 'year','month', 'day']"
-              :formatter="formatter" />
+            <van-datetime-picker
+              @confirm="dateConfirm"
+              @cancel="dateshow = false"
+              v-model="workDate"
+              type="date"
+              :min-date="minDate"
+              :max-date="maxDate"
+              :columns-order="['year', 'month', 'day']"
+              :formatter="formatter"
+            />
           </van-popup>
         </van-row>
         <van-row class="cell">
           <van-col span="6">选择街道:</van-col>
           <van-col span="18">
-            <van-field v-model="form.areaName" :rules="[{ required: true}]" @click="clickstreetShow" placeholder="请选择" disabled />
+            <van-field
+              v-model="form.areaName"
+              :rules="[{ required: true }]"
+              @click="clickstreetShow"
+              placeholder="请选择"
+            />
           </van-col>
           <!-- <van-col span="18" @click="streetshowPopup">{{form.streetName?form.streetName:'请选择'}}</van-col> -->
           <van-popup v-model="streetShow" position="bottom" :style="{ height: '50%' }">
-            <van-picker default-index="2" show-toolbar :columns="streetList" @confirm="onConfirm" @cancel="streetShow=false" value-key="name" />
+            <van-picker
+              default-index="2"
+              show-toolbar
+              :columns="streetList"
+              @confirm="onConfirm"
+              @cancel="streetShow = false"
+              value-key="name"
+            />
           </van-popup>
         </van-row>
         <van-row class="cell">
           <van-col span="6">活动地址:</van-col>
           <van-col span="18">
-            <van-field v-model="form.address" :rules="[{ required: true}]" placeholder="请输入活动地址" :disabled="id!=undefined" />
+            <van-field
+              v-model="form.address"
+              :rules="[{ required: true }]"
+              placeholder="请输入活动地址"
+              :disabled="id != undefined"
+            />
           </van-col>
         </van-row>
         <van-row class="cell">
@@ -42,20 +83,41 @@
           <van-col span="18">
             <div class="serviceTarget" @click="clickserviceTargetShow">
               <!-- {{form.helpChildren?form.helpChildren:'请选择'}} -->
-              <van-field v-model="form.helpChildren" :rules="[{ required: true}]" placeholder="请输入帮扶对象" :disabled="id!=undefined" />
+              <van-field
+                v-model="form.helpChildren"
+                :rules="[{ required: true }]"
+                placeholder="请输入帮扶对象"
+                :disabled="id != undefined"
+              />
             </div>
             <van-popup position="bottom" v-model="serviceTargetShow">
               <div class="field">
-                <div v-for="(item,index) in serviceTarget" :key="index">{{item}}
-                  <van-icon name="clear" color="#999" @click="clearserviceTarget(index)" />
+                <div v-for="(item, index) in serviceTarget" :key="index">
+                  {{ item }}
+                  <van-icon
+                    name="clear"
+                    color="#999"
+                    @click="clearserviceTarget(index)"
+                  />
                 </div>
               </div>
-              <van-search placeholder="请输入姓名查询" @input="listChildInfoByName" v-model="positionSearch" />
-              <van-picker cancel-button-text='取消' :confirm-button-text='childList.length>0?"选择":"确定"' value-key="title" show-toolbar :columns="childList" @confirm="onConfirmPicker"
-                @cancel="serviceTargetShow = false">
+              <van-search
+                placeholder="请输入姓名查询"
+                @input="listChildInfoByName"
+                v-model="positionSearch"
+              />
+              <van-picker
+                cancel-button-text="取消"
+                :confirm-button-text="childList.length > 0 ? '选择' : '确定'"
+                value-key="title"
+                show-toolbar
+                :columns="childList"
+                @confirm="onConfirmPicker"
+                @cancel="serviceTargetShow = false"
+              >
                 <template #option="item">
-                  <span>{{item.name}}</span>
-                  <span>({{item.idCard}})</span>
+                  <span>{{ item.name }}</span>
+                  <span>({{ item.idCard }})</span>
                 </template>
               </van-picker>
             </van-popup>
@@ -82,7 +144,15 @@
         <van-row class="cell">
           <van-col span="6">活动详情:</van-col>
           <van-col span="18">
-            <van-field class="textarea" :rules="[{ required: true}]" :disabled="id!=undefined" v-model="form.content" rows="1" type="textarea" placeholder="请输入活动详情" />
+            <van-field
+              class="textarea"
+              :rules="[{ required: true }]"
+              :disabled="id != undefined"
+              v-model="form.content"
+              rows="1"
+              type="textarea"
+              placeholder="请输入活动详情"
+            />
           </van-col>
         </van-row>
         <div v-if="!id">
@@ -93,26 +163,54 @@
           <div>
             <p>照片:</p>
             <div class="boximg">
-              <div v-for="(item,index) in picsArr" :key="index">
-                <van-image lazy-load fit="contain" :src="item" alt="" @click="showPopup(),startPosition=1" />
+              <div v-for="(item, index) in picsArr" :key="index">
+                <van-image
+                  lazy-load
+                  fit="contain"
+                  :src="item"
+                  alt=""
+                  @click="showPopup(), (startPosition = 1)"
+                />
               </div>
             </div>
-            <van-image-preview closeable :startPosition="startPosition" v-model="show" :images="pics"></van-image-preview>
+            <van-image-preview
+              closeable
+              :startPosition="startPosition"
+              v-model="show"
+              :images="pics"
+            ></van-image-preview>
           </div>
           <div>
             <p>视频:</p>
             <div class="boximg">
-              <div v-for="(item,index) in videos" :key="index">
-                <video @click="showvideoplay=true,videourl=item" style="object-fit:cover;" :src="item" poster='../../assets/video.png'></video>
+              <div v-for="(item, index) in videos" :key="index">
+                <video
+                  @click="(showvideoplay = true), (videourl = item)"
+                  style="object-fit: cover"
+                  :src="item"
+                  poster="../../assets/video.png"
+                ></video>
               </div>
             </div>
           </div>
         </div>
       </div>
-      <van-dialog style="width:100%;border-radius:0;height:200px" v-model="showvideoplay" :show-cancel-button="false" :show-confirm-button="false" closeOnClickOverlay>
-        <video controls preload="auto" style="width:100%;height:200px;object-fit: contain;" :src="videourl" v-if="videourl"></video>
+      <van-dialog
+        style="width: 100%; border-radius: 0; height: 200px"
+        v-model="showvideoplay"
+        :show-cancel-button="false"
+        :show-confirm-button="false"
+        closeOnClickOverlay
+      >
+        <video
+          controls
+          preload="auto"
+          style="width: 100%; height: 200px; object-fit: contain"
+          :src="videourl"
+          v-if="videourl"
+        ></video>
       </van-dialog>
-      <div style="text-align:center;" v-if="!id">
+      <div style="text-align: center" v-if="!id">
         <van-button native-type="submit">确 定</van-button>
       </div>
     </van-form>
@@ -126,8 +224,8 @@ import {
   uploadImage,
   getStreetList,
   lovingHelpDetail,
-} from '../../api/index.js'
-import vanUploader from '../../components/vanUploader.vue'
+} from "../../api/index.js";
+import vanUploader from "../../components/vanUploader.vue";
 export default {
   components: { vanUploader },
   data() {
@@ -148,192 +246,192 @@ export default {
       workDate: new Date(),
       minDate: new Date(2020, 0, 1),
       maxDate: new Date(),
-      orglist: '',
-      positionSearch: '',
+      orglist: "",
+      positionSearch: "",
       serviceTarget: [],
       childList: [],
-      id: '',
-      orgId: '',
+      id: "",
+      orgId: "",
       pics: [],
       picsArr: [],
       videos: [],
-      videourl: '',
-    }
+      videourl: "",
+    };
   },
   created() {
-    this.id = this.$route.query.id
-    console.log(this.id, 'id')
-    this.orgId = this.$route.query.orgId
-    this.getStreetList()
-    this.organizationDetail()
+    this.id = this.$route.query.id;
+    console.log(this.id, "id");
+    this.orgId = this.$route.query.orgId;
+    this.getStreetList();
+    this.organizationDetail();
 
     if (this.id) {
-      this.lovingHelpDetail()
+      this.lovingHelpDetail();
     }
   },
   methods: {
     clearserviceTarget(index) {
-      if (!this.form.serviceTarget) return
-      var serviceTarget = this.form.serviceTarget.split(',')
-      serviceTarget.splice(index, 1)
-      this.serviceTarget.splice(index, 1)
-      this.form.serviceTarget = serviceTarget.join(',')
+      if (!this.form.serviceTarget) return;
+      var serviceTarget = this.form.serviceTarget.split(",");
+      serviceTarget.splice(index, 1);
+      this.serviceTarget.splice(index, 1);
+      this.form.serviceTarget = serviceTarget.join(",");
     },
     clickdateshow() {
-      if (this.id) return
-      this.dateshow = !this.dateshow
+      if (this.id) return;
+      this.dateshow = !this.dateshow;
     },
     clickstreetShow() {
-      if (this.id) return
-      this.streetShow = !this.streetShow
+      if (this.id) return;
+      this.streetShow = !this.streetShow;
     },
     clickserviceTargetShow() {
-      if (this.id) return
-      this.serviceTargetShow = !this.serviceTargetShow
+      if (this.id) return;
+      this.serviceTargetShow = !this.serviceTargetShow;
     },
     async getStreetList() {
-      const res = await getStreetList()
-      this.streetList = res.data
+      const res = await getStreetList();
+      this.streetList = res.data;
     },
     async lovingHelpDetail() {
-      const res = await lovingHelpDetail({ id: this.id })
-      this.form = res.data
-      this.pics = res.data.pics.split(',')
+      const res = await lovingHelpDetail({ id: this.id });
+      this.form = res.data;
+      this.pics = res.data.pics.split(",");
       this.pics.forEach((item) => {
-        console.log(item)
-        if (item.indexOf('.jpg') || item.indexOf('.png')) {
-          this.picsArr.push(item.replace('/cgpimage/', '/cgpimage/240x240/'))
+        console.log(item);
+        if (item.indexOf(".jpg") || item.indexOf(".png")) {
+          this.picsArr.push(item.replace("/cgpimage/", "/cgpimage/240x240/"));
         }
-      })
-      if (!res.data.videos) return
-      this.videos = res.data.videos.split(',')
+      });
+      if (!res.data.videos) return;
+      this.videos = res.data.videos.split(",");
     },
     async listChildInfoByName() {
-      if (!this.positionSearch) return
-      const res = await listChildInfoByName({ name: this.positionSearch })
-      this.childList = res.data
+      if (!this.positionSearch) return;
+      const res = await listChildInfoByName({ name: this.positionSearch });
+      this.childList = res.data;
     },
     async organizationDetail() {
-      console.log(this.orgId, 'this.orgId')
-      const res = await organizationDetail({ id: this.orgId })
-      this.orglist = res.data
+      console.log(this.orgId, "this.orgId");
+      const res = await organizationDetail({ id: this.orgId });
+      this.orglist = res.data;
     },
     onConfirm(value) {
-      this.form.areaName = value.name
-      this.form.areaId = value.id
-      this.streetShow = false
+      this.form.areaName = value.name;
+      this.form.areaId = value.id;
+      this.streetShow = false;
     },
     dateConfirm(v) {
-      console.log(v)
-      this.form.workDate = this.timeFormat(v)
-      this.dateshow = false
+      console.log(v);
+      this.form.workDate = this.timeFormat(v);
+      this.dateshow = false;
     },
     onConfirmPicker(value) {
       if (!value) {
-        console.log(value)
-        this.serviceTargetShow = !this.serviceTargetShow
-        return
+        console.log(value);
+        this.serviceTargetShow = !this.serviceTargetShow;
+        return;
       }
-      this.serviceTarget.push(value.name)
-      this.$set(this.form, 'helpChildren', this.serviceTarget.join(','))
-      this.childList = []
-      this.positionSearch = ''
+      this.serviceTarget.push(value.name);
+      this.$set(this.form, "helpChildren", this.serviceTarget.join(","));
+      this.childList = [];
+      this.positionSearch = "";
     },
     getfileList(v, index) {
       if (index == undefined) {
         if (
-          v.indexOf('.png') != -1 ||
-          v.indexOf('.jpg') != -1 ||
-          v.indexOf('.jpeg') != -1
+          v.indexOf(".png") != -1 ||
+          v.indexOf(".jpg") != -1 ||
+          v.indexOf(".jpeg") != -1
         ) {
-          this.pics.push(v)
+          this.pics.push(v);
         } else {
-          this.videos.push(v)
+          this.videos.push(v);
         }
       } else {
-        if (v == '图片') {
-          this.pics.splice(index, 1)
+        if (v == "图片") {
+          this.pics.splice(index, 1);
         } else {
-          this.videos.splice(index, 1)
+          this.videos.splice(index, 1);
         }
       }
     },
     async lovingHelpSave() {
       if (this.pics.length == 0) {
-        this.$toast.fail('请选择至少一张图片')
-        return
+        this.$toast.fail("请选择至少一张图片");
+        return;
       }
-      this.form.pics = this.pics.join(',')
-      this.form.videos = this.videos.join(',')
-      var data = JSON.parse(JSON.stringify(this.form))
-      data.workDate = data.workDate + ' 00:00:00'
-      const res = await lovingHelpSave(data)
-      if (res.code == '0000') {
-        this.$toast.success('成功')
-        this.$router.go(-1)
+      this.form.pics = this.pics.join(",");
+      this.form.videos = this.videos.join(",");
+      var data = JSON.parse(JSON.stringify(this.form));
+      data.workDate = data.workDate + " 00:00:00";
+      const res = await lovingHelpSave(data);
+      if (res.code == "0000") {
+        this.$toast.success("成功");
+        this.$router.go(-1);
       }
     },
     showPopup() {
-      this.show = true
+      this.show = true;
     },
     getPositionList() {},
     async afterRead(file) {
-      console.log(file.file)
-      file.status = 'uploading'
-      file.message = '上传中...'
-      let formDate = new FormData()
+      console.log(file.file);
+      file.status = "uploading";
+      file.message = "上传中...";
+      let formDate = new FormData();
       //添加入参
-      formDate.append('file', file.file)
-      const res = await uploadImage(formDate)
-      if (res.code == '0000') {
-        file.status = 'success'
-        file.message = '成功'
+      formDate.append("file", file.file);
+      const res = await uploadImage(formDate);
+      if (res.code == "0000") {
+        file.status = "success";
+        file.message = "成功";
         this.form.fileList.push({
           url: res.data,
           type: file.file.type,
-        })
+        });
         // 上传图片 设置col高度
         if (this.form.fileList.length % 2 == 0) {
-          var index = 3.2 * (this.form.fileList.length / 2 + 1) + 'rem'
-          this.$refs.boxlist.style.height = index
+          var index = 3.2 * (this.form.fileList.length / 2 + 1) + "rem";
+          this.$refs.boxlist.style.height = index;
         }
       } else {
-        file.status = 'failed'
-        file.message = '上传失败'
+        file.status = "failed";
+        file.message = "上传失败";
       }
     },
     deleteUploader(v, index) {
-      console.log(index)
-      this.form.fileList.splice(index.index, 1)
+      console.log(index);
+      this.form.fileList.splice(index.index, 1);
     },
     formatter(type, val) {
-      if (type === 'year') {
-        return val + '年'
+      if (type === "year") {
+        return val + "年";
       }
-      if (type === 'month') {
-        return val + '月'
+      if (type === "month") {
+        return val + "月";
       }
-      if (type === 'day') {
-        return val + '日'
+      if (type === "day") {
+        return val + "日";
       }
-      return val
+      return val;
     },
     timeFormat(time) {
       // 时间格式化 2019-09-08
-      let year = time.getFullYear()
-      let month = time.getMonth() + 1
+      let year = time.getFullYear();
+      let month = time.getMonth() + 1;
       if (month < 10) {
-        month = '0' + month
+        month = "0" + month;
       }
 
-      let day = time.getDate()
+      let day = time.getDate();
       if (day < 10) {
-        day = '0' + day
+        day = "0" + day;
       }
-      return year + '-' + month + '-' + day
+      return year + "-" + month + "-" + day;
     },
   },
-}
+};
 </script>
 <style lang="scss" scoped>
 .tx {
@@ -483,4 +581,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 186 - 111
src/views/weibao/views/specialServices/startServiceplay.vue

@@ -1,15 +1,22 @@
 <template>
   <div>
-    <van-nav-bar title="服务信息" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
+    <van-nav-bar
+      title="服务信息"
+      @click-left="$router.back()"
+      left-arrow
+      fixed
+      placeholder
+      safe-area-inset-top
+    />
     <div class="message">
       <van-row class="row">
-        <van-col span="24">项目名称:{{dataInfo.name}}</van-col>
+        <van-col span="24">项目名称:{{ dataInfo.name }}</van-col>
       </van-row>
       <van-row class="row">
-        <van-col span="24">项目内容:{{dataInfo.content}}</van-col>
+        <van-col span="24">项目内容:{{ dataInfo.content }}</van-col>
       </van-row>
       <van-row class="row">
-        <van-col span="24">服务内容:{{dataInfo.serviceContent}}</van-col>
+        <van-col span="24">服务内容:{{ dataInfo.serviceContent }}</van-col>
       </van-row>
     </div>
     <van-form @submit="addProjectHistory">
@@ -18,19 +25,41 @@
           <van-col span="6">服务对象:</van-col>
           <van-col span="18">
             <!-- <div class="serviceTarget" @click="serviceTargetPopup">{{form.serviceTarget}}</div> -->
-            <van-field @click="serviceTargetPopup" :rules="[{ required: true}]" type="textarea" v-model="form.serviceTarget" placeholder="请输入服务对象" disabled />
+            <van-field
+              @click="serviceTargetPopup"
+              :rules="[{ required: true }]"
+              type="textarea"
+              v-model="form.serviceTarget"
+              placeholder="请输入服务对象"
+            />
             <van-popup position="bottom" v-model="serviceTargetShow">
               <div class="field">
-                <div v-for="(item,index) in serviceTarget" :key="index">{{item}}
-                  <van-icon name="clear" color="#999" @click="clearserviceTarget(index)" />
+                <div v-for="(item, index) in serviceTarget" :key="index">
+                  {{ item }}
+                  <van-icon
+                    name="clear"
+                    color="#999"
+                    @click="clearserviceTarget(index)"
+                  />
                 </div>
               </div>
-              <van-search placeholder="请输入姓名查询" @input="listChildInfoByName" v-model="positionSearch" />
-              <van-picker cancel-button-text='取消' :confirm-button-text='childList.length>0?"选择":"确定"' value-key="title" show-toolbar :columns="childList" @confirm="onConfirmPicker"
-                @cancel="serviceTargetShow = false">
+              <van-search
+                placeholder="请输入姓名查询"
+                @input="listChildInfoByName"
+                v-model="positionSearch"
+              />
+              <van-picker
+                cancel-button-text="取消"
+                :confirm-button-text="childList.length > 0 ? '选择' : '确定'"
+                value-key="title"
+                show-toolbar
+                :columns="childList"
+                @confirm="onConfirmPicker"
+                @cancel="serviceTargetShow = false"
+              >
                 <template #option="item">
-                  <span>{{item.name}}</span>
-                  <span>({{item.idCard}})</span>
+                  <span>{{ item.name }}</span>
+                  <span>({{ item.idCard }})</span>
                 </template>
               </van-picker>
             </van-popup>
@@ -39,43 +68,82 @@
         <van-row class="cell">
           <van-col span="6">服务时间:</van-col>
           <van-col span="18" @click="showPopup">
-            <van-field v-model="form.servicetTime" :rules="[{ required: true}]" placeholder="请输入服务时间" disabled />
+            <van-field
+              v-model="form.servicetTime"
+              :rules="[{ required: true }]"
+              placeholder="请输入服务时间"
+            />
             <!-- {{form.servicetTime?form.servicetTime:'请选择'}} -->
           </van-col>
           <van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
-            <van-datetime-picker @confirm="dateConfirm" @cancel="showPopup" v-model="servicetTime" type="date" :min-date="minDate" :max-date="maxDate" :columns-order="[ 'year','month', 'day']"
-              :formatter="formatter" />
+            <van-datetime-picker
+              @confirm="dateConfirm"
+              @cancel="showPopup"
+              v-model="servicetTime"
+              type="date"
+              :min-date="minDate"
+              :max-date="maxDate"
+              :columns-order="['year', 'month', 'day']"
+              :formatter="formatter"
+            />
           </van-popup>
         </van-row>
         <van-row class="cell">
           <van-col span="6">选择街道:</van-col>
           <van-col span="18" @click="streetshowPopup">
-            <van-field v-model="form.streetName" :rules="[{ required: true}]" placeholder="请选择街道" disabled />
+            <van-field
+              v-model="form.streetName"
+              :rules="[{ required: true }]"
+              placeholder="请选择街道"
+            />
             <!-- {{form.streetName?form.streetName:'请选择'}} -->
           </van-col>
           <van-popup v-model="streetShow" position="bottom" :style="{ height: '50%' }">
-            <van-picker default-index="2" show-toolbar :columns="streetList" @confirm="onConfirm" @cancel="streetshowPopup" @change="onChange" value-key="name" />
+            <van-picker
+              default-index="2"
+              show-toolbar
+              :columns="streetList"
+              @confirm="onConfirm"
+              @cancel="streetshowPopup"
+              @change="onChange"
+              value-key="name"
+            />
           </van-popup>
         </van-row>
         <van-row class="cell">
           <van-col span="6">服务地点:</van-col>
           <van-col span="18">
-            <van-field v-model="form.address" :rules="[{ required: true}]" placeholder="请输入服务地点" />
+            <van-field
+              v-model="form.address"
+              :rules="[{ required: true }]"
+              placeholder="请输入服务地点"
+            />
           </van-col>
         </van-row>
         <van-row class="cell">
           <van-col span="6">服务人员:</van-col>
           <van-col span="18">
-            <van-field v-model="form.serviceStaff" :rules="[{ required: true}]" @click="serviceShow=true" placeholder="请选择服务人员" disabled />
+            <van-field
+              v-model="form.serviceStaff"
+              :rules="[{ required: true }]"
+              @click="serviceShow = true"
+              placeholder="请选择服务人员"
+            />
             <van-popup v-model="serviceShow" position="bottom" :style="{ height: '50%' }">
               <div class="popup">
                 <div class="btn">
-                  <div @click="serviceShow=false" class="cancle">取消</div>
+                  <div @click="serviceShow = false" class="cancle">取消</div>
                   <div @click="serviceConfirm" class="confirm">确定</div>
                 </div>
                 <van-checkbox-group class="group" v-model="result">
                   <van-cell-group>
-                    <van-cell v-for="(item,index) in employeeList" clickable :key="index" :title="item.name" @click="toggle(item,index)">
+                    <van-cell
+                      v-for="(item, index) in employeeList"
+                      clickable
+                      :key="index"
+                      :title="item.name"
+                      @click="toggle(item, index)"
+                    >
                       <template #right-icon>
                         <van-checkbox :name="item.name" ref="checkboxes" />
                       </template>
@@ -89,7 +157,14 @@
         <van-row class="cell">
           <van-col span="6">服务记录:</van-col>
           <van-col span="18">
-            <van-field class="textarea" v-model="form.serviceRecord" :rules="[{ required: true}]" rows="1" type="textarea" placeholder="请输入服务记录" />
+            <van-field
+              class="textarea"
+              v-model="form.serviceRecord"
+              :rules="[{ required: true }]"
+              rows="1"
+              type="textarea"
+              placeholder="请输入服务记录"
+            />
           </van-col>
         </van-row>
         <vanUploader :text="'图片'" @getfileList="getfileList"></vanUploader>
@@ -107,13 +182,13 @@ import {
   getStreetList,
   listChildInfoByName,
   getEmployeeList,
-} from '../../api/index.js'
-import vanUploader from '../../components/vanUploader.vue'
+} from "../../api/index.js";
+import vanUploader from "../../components/vanUploader.vue";
 export default {
   components: { vanUploader },
   data() {
     return {
-      tionList: '',
+      tionList: "",
       show: false,
       streetShow: false,
       serviceTargetShow: false,
@@ -122,167 +197,167 @@ export default {
       multiMediaUrl: [],
       form: {
         fileList: [],
-        serviceTarget: '',
+        serviceTarget: "",
       },
-      streetList: '',
+      streetList: "",
       servicetTime: new Date(),
       minDate: new Date(2020, 0, 1),
       maxDate: new Date(),
       customFieldName: {
-        text: 'name',
-        id: 'id',
+        text: "name",
+        id: "id",
       },
-      dataInfo: '',
+      dataInfo: "",
       childList: [],
       serviceTarget: [],
       employeeList: [],
-      positionSearch: '',
+      positionSearch: "",
       result: [],
       serviceTargetId: [],
-    }
+    };
   },
   created() {
-    this.dataInfo = this.$route.query.item
-    this.form = { serviceTarget: '', fileList: [], ...this.dataInfo }
-    this.getStreetList()
-    this.getEmployeeList()
+    this.dataInfo = this.$route.query.item;
+    this.form = { serviceTarget: "", fileList: [], ...this.dataInfo };
+    this.getStreetList();
+    this.getEmployeeList();
   },
   methods: {
     clearserviceTarget(index) {
-      if (!this.form.serviceTarget) return
-      var serviceTarget = this.form.serviceTarget.split(',')
-      var serviceTargetId = this.form.serviceTargetId.split(',')
-      serviceTarget.splice(index, 1)
-      serviceTargetId.splice(index, 1)
-      this.serviceTarget.splice(index, 1)
-      this.serviceTargetId.splice(index, 1)
-      this.form.serviceTarget = serviceTarget.join(',')
-      this.form.serviceTargetId = serviceTargetId.join(',')
-      console.log(this.form)
+      if (!this.form.serviceTarget) return;
+      var serviceTarget = this.form.serviceTarget.split(",");
+      var serviceTargetId = this.form.serviceTargetId.split(",");
+      serviceTarget.splice(index, 1);
+      serviceTargetId.splice(index, 1);
+      this.serviceTarget.splice(index, 1);
+      this.serviceTargetId.splice(index, 1);
+      this.form.serviceTarget = serviceTarget.join(",");
+      this.form.serviceTargetId = serviceTargetId.join(",");
+      console.log(this.form);
     },
     async getEmployeeList() {
-      const res = await getEmployeeList()
-      this.employeeList = res.data
+      const res = await getEmployeeList();
+      this.employeeList = res.data;
     },
     async listChildInfoByName() {
-      if (!this.positionSearch) return
-      const res = await listChildInfoByName({ name: this.positionSearch })
-      this.childList = res.data
+      if (!this.positionSearch) return;
+      const res = await listChildInfoByName({ name: this.positionSearch });
+      this.childList = res.data;
     },
     toggle(item) {
       if (this.result.indexOf(String(item.name)) == -1) {
-        this.result.push(String(item.name))
+        this.result.push(String(item.name));
       } else {
-        var index = this.result.indexOf(String(item.name))
-        this.result.splice(index, 1)
+        var index = this.result.indexOf(String(item.name));
+        this.result.splice(index, 1);
       }
     },
     getConfirm() {},
     formatter(type, val) {
-      if (type === 'year') {
-        return val + '年'
+      if (type === "year") {
+        return val + "年";
       }
-      if (type === 'month') {
-        return val + '月'
+      if (type === "month") {
+        return val + "月";
       }
-      if (type === 'day') {
-        return val + '日'
+      if (type === "day") {
+        return val + "日";
       }
-      return val
+      return val;
     },
     timeFormat(time) {
       // 时间格式化 2019-09-08
-      let year = time.getFullYear()
-      let month = time.getMonth() + 1
+      let year = time.getFullYear();
+      let month = time.getMonth() + 1;
       if (month < 10) {
-        month = '0' + month
+        month = "0" + month;
       }
 
-      let day = time.getDate()
+      let day = time.getDate();
       if (day < 10) {
-        day = '0' + day
+        day = "0" + day;
       }
-      return year + '-' + month + '-' + day
+      return year + "-" + month + "-" + day;
     },
     showPopup() {
-      this.show = !this.show
+      this.show = !this.show;
     },
     serviceTargetPopup() {
-      this.serviceTargetShow = !this.serviceTargetShow
+      this.serviceTargetShow = !this.serviceTargetShow;
     },
     streetshowPopup() {
-      this.streetShow = !this.streetShow
+      this.streetShow = !this.streetShow;
     },
     onChange() {},
     onConfirm(value) {
-      this.form.streetName = value.name
-      this.form.streetId = value.id
-      this.form.areaId = value.id
-      this.streetShow = false
+      this.form.streetName = value.name;
+      this.form.streetId = value.id;
+      this.form.areaId = value.id;
+      this.streetShow = false;
     },
     serviceConfirm() {
-      this.form.serviceStaff = this.result.join(',')
-      this.serviceShow = false
+      this.form.serviceStaff = this.result.join(",");
+      this.serviceShow = false;
     },
     onConfirmPicker(value) {
       if (!value) {
-        console.log(value)
-        this.serviceTargetShow = !this.serviceTargetShow
-        return
+        console.log(value);
+        this.serviceTargetShow = !this.serviceTargetShow;
+        return;
       }
-      this.serviceTarget.push(value.name)
-      this.serviceTargetId.push(value.childId)
-      this.$set(this.form, 'serviceTarget', this.serviceTarget.join(','))
-      this.$set(this.form, 'serviceTargetId', this.serviceTargetId.join(','))
-      this.childList = []
-      this.positionSearch = ''
+      this.serviceTarget.push(value.name);
+      this.serviceTargetId.push(value.childId);
+      this.$set(this.form, "serviceTarget", this.serviceTarget.join(","));
+      this.$set(this.form, "serviceTargetId", this.serviceTargetId.join(","));
+      this.childList = [];
+      this.positionSearch = "";
     },
     dateConfirm(v) {
-      console.log(v)
-      this.form.servicetTime = this.timeFormat(v)
-      this.show = false
+      console.log(v);
+      this.form.servicetTime = this.timeFormat(v);
+      this.show = false;
     },
     getfileList(v, index) {
       if (index == undefined) {
         if (
-          v.indexOf('.png') != -1 ||
-          v.indexOf('.jpg') != -1 ||
-          v.indexOf('.jpeg') != -1
+          v.indexOf(".png") != -1 ||
+          v.indexOf(".jpg") != -1 ||
+          v.indexOf(".jpeg") != -1
         ) {
-          this.imgUrl.push(v)
+          this.imgUrl.push(v);
         } else {
-          this.multiMediaUrl.push(v)
+          this.multiMediaUrl.push(v);
         }
       } else {
-        if (v == '图片') {
-          this.imgUrl.splice(index, 1)
+        if (v == "图片") {
+          this.imgUrl.splice(index, 1);
         } else {
-          this.multiMediaUrl.splice(index, 1)
+          this.multiMediaUrl.splice(index, 1);
         }
       }
     },
     async addProjectHistory() {
       if (this.imgUrl.length == 0) {
-        this.$toast.fail('请选择至少一张图片')
-        return
+        this.$toast.fail("请选择至少一张图片");
+        return;
       }
-      this.form.multiMediaUrl = this.multiMediaUrl.join(',')
-      this.form.imgUrl = this.imgUrl.join(',')
-      var data = JSON.parse(JSON.stringify(this.form))
-      data.servicetTime = data.servicetTime + ' 00:00:00'
-      const res = await addProjectHistory(data)
-      if (res.code == '0000') {
-        this.$toast.success('成功')
-        this.$router.go(-1)
+      this.form.multiMediaUrl = this.multiMediaUrl.join(",");
+      this.form.imgUrl = this.imgUrl.join(",");
+      var data = JSON.parse(JSON.stringify(this.form));
+      data.servicetTime = data.servicetTime + " 00:00:00";
+      const res = await addProjectHistory(data);
+      if (res.code == "0000") {
+        this.$toast.success("成功");
+        this.$router.go(-1);
       }
     },
     async getStreetList() {
-      const res = await getStreetList()
-      this.streetList = res.data
-      console.log(this.streetList, 'this.streetList')
+      const res = await getStreetList();
+      this.streetList = res.data;
+      console.log(this.streetList, "this.streetList");
     },
   },
-}
+};
 </script>
 <style lang="scss" scoped>
 .field {
@@ -404,4 +479,4 @@ export default {
   color: #333;
   -webkit-text-fill-color: unset;
 }
-</style>
+</style>