D4THYL3\long преди 3 години
родител
ревизия
80fa84fcb7

+ 10 - 1
operationSupport/src/views/businessManagement/opportunityManagement/index.js

@@ -12,7 +12,16 @@ export default {
                 },
                 {
                     label: '商机来源',
-                    prop: 'businessSource'
+                    prop: 'businessSource',
+                    format(val) {
+                        if (val == 1) {
+                            return '线上预约';
+                        } else if (val == 2) {
+                            return '线上电话';
+                        } else if (val == 3) {
+                            return '线下访问';
+                        }
+                    }
                 },
                 {
                     label: '意向等级',

+ 200 - 123
operationSupport/src/views/businessManagement/opportunityManagement/index.vue

@@ -1,138 +1,215 @@
 <template>
-    <div class="main">
-        <div class="search">
-            <el-input placeholder="输入客户姓名/电话" class="search-input" clearable v-model="mixins_query.name"></el-input>
-            <el-select placeholder="意向等级" clearable v-model="mixins_query.intentionGrade">
-                <el-option label="高" :value="0"></el-option>
-                <el-option label="中" :value="1"></el-option>
-                <el-option label="低" :value="2"></el-option>
-            </el-select>
-            <el-select placeholder="招商进度" clearable v-model="mixins_query.businessStatus">
-                <el-option label="意向" :value="0"></el-option>
-                <el-option label="参观" :value="1"></el-option>
-                <el-option label="商务洽谈" :value="2"></el-option>
-                <el-option label="签订合同" :value="3"></el-option>
-                <el-option label="失败" :value="4"></el-option>
-            </el-select>
-            <el-date-picker
-                value-format="yyyy-MM-dd"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                @change="timeToggle"
-                v-model="pickerTime"
-                :editable="false"
-            ></el-date-picker>
-            <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询</el-button>
-            <div class="search-icon">
-                <el-tooltip class="item" effect="light" placement="bottom" content="新增">
-                    <i class="zoniot_font zoniot-icon-tianjia2" @click="add('add')"></i>
-                </el-tooltip>
-                <el-tooltip class="item" effect="light" placement="bottom" content="导出">
-                    <i class="zoniot_font zoniot-icon-daochu2" @click="exportExcel()"></i>
-                </el-tooltip>
-            </div>
-        </div>
-        <zz-table
-            :cols="cols"
-            :settings="{ showCheckbox: true, showIndex: true, stripe: true }"
-            :data="mixins_list"
-            :pageset="mixins_pageset"
-            @page-change="pageChange"
-            @selection-change="selectionChange"
+  <div class="main">
+    <div class="search">
+      <el-input
+        placeholder="输入客户姓名/电话"
+        class="search-input"
+        clearable
+        v-model="mixins_query.name"
+      ></el-input>
+      <el-select
+        placeholder="意向等级"
+        clearable
+        v-model="mixins_query.intentionGrade"
+      >
+        <el-option
+          label="高"
+          :value="0"
+        ></el-option>
+        <el-option
+          label="中"
+          :value="1"
+        ></el-option>
+        <el-option
+          label="低"
+          :value="2"
+        ></el-option>
+      </el-select>
+      <el-select
+        placeholder="招商进度"
+        clearable
+        v-model="mixins_query.businessStatus"
+      >
+        <el-option
+          label="意向"
+          :value="1"
+        ></el-option>
+        <el-option
+          label="参观"
+          :value="2"
+        ></el-option>
+        <el-option
+          label="商务洽谈"
+          :value="3"
+        ></el-option>
+        <el-option
+          label="签订合同"
+          :value="4"
+        ></el-option>
+        <el-option
+          label="失败"
+          :value="5"
+        ></el-option>
+      </el-select>
+      <el-date-picker
+        value-format="yyyy-MM-dd"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        @change="timeToggle"
+        v-model="pickerTime"
+        :editable="false"
+      ></el-date-picker>
+      <el-button
+        type="primary"
+        class="search-btn"
+        @click="mixins_search"
+        icon="el-icon-search"
+      >查询</el-button>
+      <div class="search-icon">
+        <el-tooltip
+          class="item"
+          effect="light"
+          placement="bottom"
+          content="新增"
+        >
+          <i
+            class="zoniot_font zoniot-icon-tianjia2"
+            @click="add('add')"
+          ></i>
+        </el-tooltip>
+        <el-tooltip
+          class="item"
+          effect="light"
+          placement="bottom"
+          content="导出"
         >
-            <template slot-scope="scope" slot="opt">
-                <div class="opt">
-                    <el-tooltip class="item" effect="light" placement="bottom" content="编辑">
-                        <i class="zoniot_font zoniot-icon-bianji" @click="add('edit', scope.row.id)"></i>
-                    </el-tooltip>
-                    <el-tooltip class="item" effect="light" placement="bottom" content="查看">
-                        <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
-                    </el-tooltip>
-                </div>
-            </template>
-        </zz-table>
+          <i
+            class="zoniot_font zoniot-icon-daochu2"
+            @click="exportExcel()"
+          ></i>
+        </el-tooltip>
+      </div>
     </div>
+    <zz-table
+      :cols="cols"
+      :settings="{ showCheckbox: true, showIndex: true, stripe: true }"
+      :data="mixins_list"
+      :pageset="mixins_pageset"
+      @page-change="pageChange"
+      @selection-change="selectionChange"
+    >
+      <template
+        slot-scope="scope"
+        slot="opt"
+      >
+        <div class="opt">
+          <el-tooltip
+            class="item"
+            effect="light"
+            placement="bottom"
+            content="编辑"
+          >
+            <i
+              class="zoniot_font zoniot-icon-bianji"
+              @click="add('edit', scope.row.id)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            class="item"
+            effect="light"
+            placement="bottom"
+            content="查看"
+          >
+            <i
+              class="zoniot_font zoniot-icon-xiangqing"
+              @click="lookDetails(scope.row)"
+            ></i>
+          </el-tooltip>
+        </div>
+      </template>
+    </zz-table>
+  </div>
 </template>
 
 <script>
 import index from './index';
 import list from '@utils/list';
 export default {
-    mixins: [index, list],
-    data() {
-        return {
-            mixins_post: 'get',
-            pickerTime: [],
-            findUser: []
-        };
+  mixins: [index, list],
+  data () {
+    return {
+      mixins_post: 'get',
+      pickerTime: [],
+      findUser: []
+    };
+  },
+  created () {
+    this.mixins_dataUrl = '/sc-community-web/business/page';
+    this.mixins_query = {};
+    this.mixins_search();
+    this.getUserList();
+  },
+  mounted () { },
+  methods: {
+    timeToggle (e) {
+      console.log(e);
+      let start = '00:00:00',
+        end = '23:59:59';
+      if (!!e) {
+        this.mixins_query.startDate = `${e[0]} ${start}`;
+        this.mixins_query.endDate = `${e[1]} ${end}`;
+      } else {
+        this.mixins_query.startDate = ``;
+        this.mixins_query.endDate = ``;
+      }
     },
-    created() {
-        this.mixins_dataUrl = '/sc-community-web/business/page';
-        this.mixins_query = {};
+    add (todo, data) {
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/businessManagement/opportunityManagement/setpPage/add.vue',
+          width: '665px',
+          height: '700px',
+          props: {
+            todo,
+            data,
+            callback: resolve,
+            arrData: this.findUser
+          },
+          title: todo == 'add' ? '添加商机' : '修改商机'
+        });
+      }).then(() => {
         this.mixins_search();
-        this.getUserList();
+      });
+    },
+    lookDetails (row) {
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/businessManagement/opportunityManagement/setpPage/details.vue',
+          width: '900px',
+          height: '581px',
+          props: {
+            id: row.id,
+            callback: resolve
+          },
+          showConfirmButton: true,
+          showCancelButton: true,
+          hideStar: true,
+          title: '商机详情'
+        });
+      }).then(() => {
+        this.mixins_search();
+      });
+    },
+    exportExcel () {
+      this.__exportExcel('/sc-community-web/business/excel', this.mixins_query);
     },
-    mounted() {},
-    methods: {
-        timeToggle(e) {
-            console.log(e);
-            let start = '00:00:00',
-                end = '23:59:59';
-            if (!!e) {
-                this.mixins_query.startDate = `${e[0]} ${start}`;
-                this.mixins_query.endDate = `${e[1]} ${end}`;
-            } else {
-                this.mixins_query.startDate = ``;
-                this.mixins_query.endDate = ``;
-            }
-        },
-        add(todo, data) {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/businessManagement/opportunityManagement/setpPage/add.vue',
-                    width: '665px',
-                    height: '700px',
-                    props: {
-                        todo,
-                        data,
-                        callback: resolve,
-                        arrData: this.findUser
-                    },
-                    title: todo == 'add' ? '添加商机' : '修改商机'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
-        },
-        lookDetails(row) {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/businessManagement/opportunityManagement/setpPage/details.vue',
-                    width: '900px',
-                    height: '581px',
-                    props: {
-                        id: row.id,
-                        callback: resolve
-                    },
-                    showConfirmButton: true,
-                    showCancelButton: true,
-                    hideStar: true,
-                    title: '商机详情'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
-        },
-        exportExcel() {
-            this.__exportExcel('/sc-community-web/business/excel', this.mixins_query);
-        },
-        getUserList() {
-            this.$http.get('/sc-user-center/user/findUserList').then(({ data, status, msg }) => {
-                this.findUser = data;
-            });
-        }
+    getUserList () {
+      this.$http.get('/sc-user-center/user/findUserList').then(({ data, status, msg }) => {
+        this.findUser = data;
+      });
     }
+  }
 };
 </script>

+ 530 - 398
operationSupport/src/views/businessManagement/opportunityManagement/setpPage/add.vue

@@ -1,428 +1,560 @@
 <template>
-    <div class="formContent">
-        <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="85px">
-            <div class="formContent-item_title">客户信息</div>
-            <el-form-item label="客户姓名" prop="name" class="show-required-icon-star">
-                <el-input v-model="formData.name" clearable placeholder="请输入客户名称"></el-input>
-            </el-form-item>
-            <el-form-item label="客户手机" prop="telephon">
-                <el-input v-model="formData.telephon" clearable placeholder="请输入客户手机"></el-input>
-            </el-form-item>
-            <el-form-item label="客户类型" prop="customerType">
-                <el-select v-model="formData.customerType" @change="changeInformType" clearable class="dialog-select" placeholder="请选择">
-                    <el-option v-for="(item, index) in informTypes" :key="index" :label="item.label" :value="item.status"></el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="商机来源" prop="businessOpportunity">
-                <el-select
-                    v-model="formData.businessOpportunity"
-                    @change="changeInformType"
-                    clearable
-                    class="dialog-select"
-                    placeholder="请选择"
-                >
-                    <el-option v-for="(item, index) in Business" :key="index" :label="item.label" :value="item.status">{{
+  <div class="formContent">
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="rules"
+      label-width="85px"
+      class="demo-ruleForm"
+    >
+      <div class="formContent-item_title">客户信息</div>
+      <el-form-item
+        label="客户姓名"
+        prop="name"
+        class="show-required-icon-star"
+      >
+        <el-input
+          v-model="formData.name"
+          clearable
+          placeholder="请输入客户名称"
+        ></el-input>
+      </el-form-item>
+      <el-form-item
+        label="客户手机"
+        prop="telephon"
+      >
+        <el-input
+          v-model="formData.telephon"
+          clearable
+          placeholder="请输入客户手机"
+        ></el-input>
+      </el-form-item>
+      <el-form-item
+        label="客户类型"
+        prop="customerType"
+      >
+        <el-select
+          v-model="formData.customerType"
+          @change="changeInformType"
+          clearable
+          class="dialog-select"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="(item, index) in informTypes"
+            :key="index"
+            :label="item.label"
+            :value="item.status"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="商机来源"
+        prop="businessOpportunity"
+      >
+        <el-select
+          v-model="formData.businessOpportunity"
+          @change="changeInformType"
+          clearable
+          class="dialog-select"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="(item, index) in Business"
+            :key="index"
+            :label="item.label"
+            :value="item.status"
+          >{{
                         item.label
                     }}</el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="需求类型" prop="demandType">
-                <el-select v-model="formData.demandType" @change="changeInformType" clearable class="dialog-select" placeholder="请选择">
-                    <el-option v-for="(item, index) in Demand" :key="index" :label="item.label" :value="item.status">{{
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="需求类型"
+        prop="demandType"
+      >
+        <el-select
+          v-model="formData.demandType"
+          @change="changeInformType"
+          clearable
+          class="dialog-select"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="(item, index) in Demand"
+            :key="index"
+            :label="item.label"
+            :value="item.status"
+          >{{
                         item.label
                     }}</el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="意向等级" prop="intentionLevel">
-                <el-select
-                    v-model="formData.intentionLevel"
-                    @change="changeInformType"
-                    clearable
-                    class="dialog-select"
-                    placeholder="请选择"
-                >
-                    <el-option v-for="(item, index) in Intention" :key="index" :label="item.label" :value="item.status">{{
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="意向等级"
+        prop="intentionLevel"
+      >
+        <el-select
+          v-model="formData.intentionLevel"
+          @change="changeInformType"
+          clearable
+          class="dialog-select"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="(item, index) in Intention"
+            :key="index"
+            :label="item.label"
+            :value="item.status"
+          >{{
                         item.label
                     }}</el-option>
-                </el-select>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="备注"
+        prop="remarks"
+        style=""
+      >
+        <el-input
+          type="textarea"
+          :rows="4"
+          show-word-limit
+          v-model="formData.remarks"
+          maxlength="300"
+        ></el-input>
+      </el-form-item>
+
+      <div class="formContent-item_title">物业信息</div>
+      <div
+        v-for="(item, indexs) in timePeriod"
+        :key="indexs"
+      >
+        <el-row>
+          <el-col :span="8">
+            <el-form-item
+              label="意向房屋"
+              prop="timePeriod"
+            >
+              <el-select
+                v-model="item.communityid"
+                clearable
+                class="dialog-select"
+                placeholder="社区"
+              >
+                <el-option
+                  v-for="(items, index) in community"
+                  :key="index"
+                  :label="items.name"
+                  :value="items.value"
+                  label-width="100px"
+                  @click.native="changeInformcommunity(items, indexs)"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="备注" prop="remarks">
-                <el-input type="textarea" :rows="4" show-word-limit v-model="formData.remarks" maxlength="300"></el-input>
+          </el-col>
+          <el-col :span="4">
+            <el-select
+              v-model="item.buildingid"
+              clearable
+              class="dialog-select"
+              placeholder="楼栋"
+            >
+              <el-option
+                v-for="(buildingids, index) in Building[indexs]"
+                :key="index"
+                :label="buildingids.name"
+                :value="buildingids.value"
+                label-width="100px"
+                @click.native="changeInformbuilding(buildingids, indexs)"
+              ></el-option>
+            </el-select>
+          </el-col>
+          <el-col :span="4">
+            <el-select
+              v-model="item.unitid"
+              clearable
+              class="dialog-select"
+              placeholder="单元"
+            >
+              <el-option
+                v-for="(unitids, index) in unit[indexs]"
+                :key="index"
+                :label="unitids.name"
+                :value="unitids.value"
+                label-width="100px"
+                @click.native="changeInformunit(unitids, indexs)"
+              ></el-option>
+            </el-select>
+          </el-col>
+          <el-col :span="4">
+            <el-select
+              v-model="item.roomNumberid"
+              clearable
+              class="dialog-select"
+              placeholder="房间号"
+            >
+              <el-option
+                v-for="(roomNumberids, index) in roomNumber[indexs]"
+                :key="index"
+                :label="roomNumberids.name"
+                :value="roomNumberids.value"
+                label-width="100px"
+                @click.native="changeInformroomNumber(roomNumberids)"
+              >
+              </el-option>
+            </el-select>
+          </el-col>
+          <div
+            class="sunm"
+            @click="addTime(indexs, 1)"
+            style="display: inline-block; line-height: 30px"
+          >
+            <i class="zoniot_font zoniot-icon-tianjia1"></i>
+          </div>
+          <div
+            class="sunm"
+            @click="addTime(indexs, -1)"
+            v-if="timePeriod.length > 1 && indexs != 0"
+            style="display: inline-block; line-height: 30px"
+          >
+            <i class="zoniot_font zoniot-icon-shanjian"></i>
+          </div>
+        </el-row>
+      </div>
+      <template>
+        <div class="formContent-item_title">招商信息</div>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item
+              label="招商人员"
+              prop="username"
+            >
+              <el-cascader
+                ref="userName"
+                v-model="formData.userId"
+                :props="defaultProps"
+                :options="findUser"
+                @change="findUserToggle"
+              ></el-cascader>
             </el-form-item>
-
-            <div class="formContent-item_title">物业信息</div>
-            <div v-for="(item, indexs) in timePeriod" :key="indexs">
-                <el-row>
-                    <el-col :span="8">
-                        <el-form-item label="意向房屋" prop="timePeriod">
-                            <el-select v-model="item.communityid" clearable class="dialog-select" placeholder="社区">
-                                <el-option
-                                    v-for="(items, index) in community"
-                                    :key="index"
-                                    :label="items.name"
-                                    :value="items.value"
-                                    label-width="100px"
-                                    @click.native="changeInformcommunity(items, indexs)"
-                                ></el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="4">
-                        <el-select v-model="item.buildingid" clearable class="dialog-select" placeholder="楼栋">
-                            <el-option
-                                v-for="(buildingids, index) in Building[indexs]"
-                                :key="index"
-                                :label="buildingids.name"
-                                :value="buildingids.value"
-                                label-width="100px"
-                                @click.native="changeInformbuilding(buildingids, indexs)"
-                            ></el-option>
-                        </el-select>
-                    </el-col>
-                    <el-col :span="4">
-                        <el-select v-model="item.unitid" clearable class="dialog-select" placeholder="单元">
-                            <el-option
-                                v-for="(unitids, index) in unit[indexs]"
-                                :key="index"
-                                :label="unitids.name"
-                                :value="unitids.value"
-                                label-width="100px"
-                                @click.native="changeInformunit(unitids, indexs)"
-                            ></el-option>
-                        </el-select>
-                    </el-col>
-                    <el-col :span="4">
-                        <el-select v-model="item.roomNumberid" clearable class="dialog-select" placeholder="房间号">
-                            <el-option
-                                v-for="(roomNumberids, index) in roomNumber[indexs]"
-                                :key="index"
-                                :label="roomNumberids.name"
-                                :value="roomNumberids.value"
-                                label-width="100px"
-                                @click.native="changeInformroomNumber(roomNumberids)"
-                            >
-                            </el-option>
-                        </el-select>
-                    </el-col>
-                    <div class="sunm" @click="addTime(indexs, 1)" style="display: inline-block; line-height: 30px">
-                        <i class="zoniot_font zoniot-icon-tianjia1"></i>
-                    </div>
-                    <div
-                        class="sunm"
-                        @click="addTime(indexs, -1)"
-                        v-if="timePeriod.length > 1 && indexs != 0"
-                        style="display: inline-block; line-height: 30px"
-                    >
-                        <i class="zoniot_font zoniot-icon-shanjian"></i>
-                    </div>
-                </el-row>
-            </div>
-            <template>
-                <div class="formContent-item_title">招商信息</div>
-                <el-row>
-                    <el-col :span="8">
-                        <el-form-item label="招商人员" prop="username">
-                            <el-cascader
-                                ref="userName"
-                                v-model="formData.userId"
-                                :props="defaultProps"
-                                :options="findUser"
-                                @change="findUserToggle"
-                            ></el-cascader>
-                        </el-form-item>
-                    </el-col>
-                </el-row>
-            </template>
-        </el-form>
-    </div>
+          </el-col>
+        </el-row>
+      </template>
+    </el-form>
+  </div>
 </template>
 
 <script>
 import list from '@utils/list';
 export default {
-    props: ['params'],
-    data() {
-        return {
-            formData: {
-                name: '',
-                telephon: '',
-                customerType: '',
-                businessOpportunity: '',
-                demandType: '',
-                intentionLevel: '',
-                remarks: '',
-                communityid: '',
-                buildingid: '',
-                unitid: '',
-                roomNumberid: '',
+  props: ['params'],
+  data () {
+    return {
+      formData: {
+        name: '',
+        telephon: '',
+        customerType: '',
+        businessOpportunity: '',
+        demandType: '',
+        intentionLevel: '',
+        remarks: '',
+        communityid: '',
+        buildingid: '',
+        unitid: '',
+        roomNumberid: '',
 
-                userId: '',
-                username: '',
-                FnroomNumberid: []
-            },
-            timePeriod: [
-                {
-                    communityid: '',
-                    Buildingid: '',
-                    unitid: '',
-                    roomNumberid: ''
-                }
-            ],
-            informTypes: [
-                {
-                    status: 0,
-                    label: '个人'
-                },
-                {
-                    status: 1,
-                    label: '企业'
-                }
-            ],
-            Business: [
-                {
-                    status: 0,
-                    label: '线上预约'
-                },
-                {
-                    status: 1,
-                    label: '线上电话'
-                },
-                {
-                    status: 2,
-                    label: '线下访问'
-                }
-            ],
-            Demand: [
-                {
-                    status: 0,
-                    label: '住宅'
-                },
-                {
-                    status: 1,
-                    label: '商业'
-                }
-            ],
-            Intention: [
-                {
-                    status: 0,
-                    label: '高'
-                },
-                {
-                    status: 1,
-                    label: '中'
-                },
-                {
-                    status: 2,
-                    label: '低'
-                }
-            ],
-            // 社区
-            community: [],
-            // 楼栋
-            Building: [],
-            // 单元
-            unit: [],
-            // 房间号
-            roomNumber: [],
-            Merchants: [],
-            listRes: [],
-            room: 'false',
-            urlencoded: [],
-            findUser: [],
-            defaultProps: {
-                value: 'id', // 唯一标识
-                label: 'label', // 标签显示
-                children: 'children',
-                emitPath: false
-            }
-        };
-    },
-    methods: {
-        addTime(inx, sun) {
-            if (sun > 0) {
-                this.timePeriod.push({
-                    communityid: '',
-                    Buildingid: '',
-                    unitid: '',
-                    roomNumberid: ''
-                });
-                this.room = 'true';
-            } else {
-                this.timePeriod.splice(inx, 1);
-                this.room = 'false';
-            }
-        },
-        close() {
-            this.$emit('initPage');
-        },
-        submit() {
-            console.log('this.formData.intentionLevel', this.formData.intentionLevel);
-            this.$refs.ruleForm.validate((valid) => {
-                if (valid) {
-                    let url = '/sc-community-web/business/add';
-                    if (this.params.todo == 'edit') {
-                        url = '/sc-community-web/business/edit';
-                    }
-                    let houseIds = [];
-                    this.timePeriod.map((item) => {
-                        houseIds.push(item.roomNumberid);
-                    });
-                    let installparams = {
-                        id: this.params.data,
-                        clientName: this.formData.name,
-                        clientPhone: this.formData.telephon,
-                        clientType: this.formData.customerType,
-                        businessSource: this.formData.businessOpportunity,
-                        demandSource: this.formData.demandType,
-                        intentionGrade: this.formData.intentionLevel,
-                        remark: this.formData.remarks,
-                        houseIds: houseIds,
-                        userId: this.formData.userId,
-                        username: this.formData.username
-                    };
-
-                    this.$http
-                        .post(url, installparams)
-                        .then(({ status, msg }) => {
-                            if (status == 0) {
-                                this.$message.success(msg);
-                                this.params.callback && this.params.callback();
-                                this.$emit('close');
-                            } else {
-                                this.$message.error(msg);
-                            }
-                        })
-                        .catch(() => {});
-                }
-            });
-        },
-        // 社区名称
-        changeInformcommunity(items, index) {
-            console.log(items);
-            this.Fncommunity(items, index);
-        },
-        Fncommunity(items, index) {
-            let BuildingArr = [];
-
-            if (!!this.Building[index]) {
-                this.Building[index] = items.children;
-            } else {
-                this.Building.push(items.children);
-            }
+        userId: '',
+        username: '',
+        FnroomNumberid: []
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入名称', trigger: 'blur' },
+        ],
+        telephon: [
+          { required: true, message: '请输入电话', trigger: 'blur' },
+        ],
+        customerType: [
+          { required: true, message: '请输确认类型', trigger: 'blur' },
+        ],
+        businessOpportunity: [
+          { required: true, message: '请确认商机来源', trigger: 'blur' },
+        ],
+        demandType: [
+          { required: true, message: '请确认需求类型', trigger: 'blur' },
+        ],
+        intentionLevel: [
+          { required: true, message: '请确认意向等级', trigger: 'blur' },
+        ],
+        username: [
+          { required: true, message: '请确认招商人员', trigger: 'blur' },
+        ]
+      },
+      timePeriod: [
+        {
+          communityid: '',
+          Buildingid: '',
+          unitid: '',
+          roomNumberid: ''
+        }
+      ],
+      informTypes: [
+        {
+          status: 0,
+          label: '个人'
         },
-        // 单元
-        changeInformbuilding(items, index) {
-            this.Fnbuilding(items, index);
+        {
+          status: 1,
+          label: '企业'
+        }
+      ],
+      Business: [
+        {
+          status: 1,
+          label: '线上预约'
         },
-        Fnbuilding(items, index) {
-            let unitArr = [];
-            for (let i = 0; i < items.length; i++) {
-                unitArr.push({
-                    id: items[i].id,
-                    name: items[i].name,
-                    children: items.children
-                });
-            }
-            debugger;
-            if (items.children[0].type == 'room') {
-                if (!!this.roomNumber[index]) {
-                    this.roomNumber[index] = items.children;
-                } else {
-                    this.roomNumber.push(items.children);
-                }
-            } else {
-                if (!!this.unit[index]) {
-                    this.unit[index] = items.children;
-                } else {
-                    this.unit.push(items.children);
-                }
-            }
+        {
+          status: 2,
+          label: '线上电话'
         },
-        changeInformunit(items, index) {
-            this.Fnunit(items, index);
+        {
+          status: 3,
+          label: '线下访问'
+        }
+      ],
+      Demand: [
+        {
+          status: 0,
+          label: '住宅'
         },
-        Fnunit(items, index) {
-            let roomNumberArr = [];
-            for (let i = 0; i < items.length; i++) {
-                roomNumberArr.push({
-                    id: items[i].id,
-                    name: items[i].name,
-                    children: items.children
-                });
-            }
-
-            if (!!this.roomNumber[index]) {
-                this.roomNumber[index] = items.children;
-            } else {
-                this.roomNumber.push(items.children);
-            }
+        {
+          status: 1,
+          label: '商业'
+        }
+      ],
+      Intention: [
+        {
+          status: 1,
+          label: '高'
         },
-        changeInformroomNumber(items) {
-            // if (this.room == 'false') {
-            //     this.formData.FnroomNumberid = [];
-            // }
-            // this.formData.FnroomNumberid.push(items.value);
+        {
+          status: 2,
+          label: '中'
         },
-        findUserToggle() {
-            this.formData.username = this.$refs.userName.getCheckedNodes()[0].label;
+        {
+          status: 3,
+          label: '低'
         }
+      ],
+      // 社区
+      community: [],
+      // 楼栋
+      Building: [],
+      // 单元
+      unit: [],
+      // 房间号
+      roomNumber: [],
+      Merchants: [],
+      listRes: [],
+      room: 'false',
+      urlencoded: [],
+      findUser: [],
+      defaultProps: {
+        value: 'id', // 唯一标识
+        label: 'label', // 标签显示
+        children: 'children',
+        emitPath: false
+      }
+    };
+  },
+  methods: {
+    addTime (inx, sun) {
+      if (sun > 0) {
+        this.timePeriod.push({
+          communityid: '',
+          Buildingid: '',
+          unitid: '',
+          roomNumberid: ''
+        });
+        this.room = 'true';
+      } else {
+        this.timePeriod.splice(inx, 1);
+        this.room = 'false';
+      }
+    },
+    close () {
+      this.$emit('initPage');
     },
-    created() {
-        this.findUser = this.params.arrData;
+    submit () {
+      console.log('this.formData.intentionLevel', this.formData.intentionLevel);
+      this.$refs.formData.validate((valid) => {
+        if (valid) {
+          let url = '/sc-community-web/business/add';
+          if (this.params.todo == 'edit') {
+            url = '/sc-community-web/business/edit';
+          }
+          let houseIds = [];
+          this.timePeriod.map((item) => {
+            houseIds.push(item.roomNumberid);
+          });
+          let installparams = {
+            id: this.params.data,
+            clientName: this.formData.name,
+            clientPhone: this.formData.telephon,
+            clientType: this.formData.customerType,
+            businessSource: this.formData.businessOpportunity,
+            demandSource: this.formData.demandType,
+            intentionGrade: this.formData.intentionLevel,
+            remark: this.formData.remarks,
+            houseIds: houseIds,
+            userId: this.formData.userId,
+            username: this.formData.username
+          };
 
-        let url = '/sc-community/assets/tree/community/find?buildingType=1';
-        this.$http.get(url).then(({ status, msg, data }) => {
-            if (status == 0) {
-                this.close();
-                this.urlencoded = data;
-            } else {
+          this.$http
+            .post(url, installparams)
+            .then(({ status, msg }) => {
+              if (status == 0) {
+                this.$message.success(msg);
+                this.params.callback && this.params.callback();
+                this.$emit('close');
+              } else {
                 this.$message.error(msg);
-            }
+              }
+            })
+            .catch(() => { });
+        }
+      });
+    },
+    // 社区名称
+    changeInformcommunity (items, index) {
+      console.log(items);
+      this.Fncommunity(items, index);
+    },
+    Fncommunity (items, index) {
+      let BuildingArr = [];
+
+      if (!!this.Building[index]) {
+        this.Building[index] = items.children;
+      } else {
+        this.Building.push(items.children);
+      }
+    },
+    // 单元
+    changeInformbuilding (items, index) {
+      this.Fnbuilding(items, index);
+    },
+    Fnbuilding (items, index) {
+      let unitArr = [];
+      for (let i = 0; i < items.length; i++) {
+        unitArr.push({
+          id: items[i].id,
+          name: items[i].name,
+          children: items.children
+        });
+      }
+      debugger;
+      if (items.children[0].type == 'room') {
+        if (!!this.roomNumber[index]) {
+          this.roomNumber[index] = items.children;
+        } else {
+          this.roomNumber.push(items.children);
+        }
+      } else {
+        if (!!this.unit[index]) {
+          this.unit[index] = items.children;
+        } else {
+          this.unit.push(items.children);
+        }
+      }
+    },
+    changeInformunit (items, index) {
+      this.Fnunit(items, index);
+    },
+    Fnunit (items, index) {
+      let roomNumberArr = [];
+      for (let i = 0; i < items.length; i++) {
+        roomNumberArr.push({
+          id: items[i].id,
+          name: items[i].name,
+          children: items.children
         });
-        if (this.params.todo == 'edit') {
-            console.log(this.params.data);
-            let url = `/sc-community-web/business/find/${this.params.data}`;
-            this.$http.get(url).then(({ status, msg, data }) => {
-                if (status == 0) {
-                    this.close();
-                    console.log('data', data);
-                    this.formData = {
-                        name: data.clientName + '',
-                        telephon: data.clientPhone + '',
-                        customerType: data.clientType,
-                        businessOpportunity: data.businessSource,
-                        demandType: data.demandSource,
-                        intentionLevel: data.intentionGrade,
-                        remarks: data.remark + '',
-                        userId: data.userId,
-                        username: data.username
-                    };
-                    let timePeriodObj = [];
-                    if (data.houseList.length == 0) {
-                        timePeriodObj = [
-                            {
-                                communityid: '',
-                                buildingid: '',
-                                unitid: '',
-                                roomNumberid: ''
-                            }
-                        ];
-                    } else {
-                        for (let i = 0; i < data.houseList.length; i++) {
-                            timePeriodObj.push({
-                                communityid: data.houseList[i].communityName,
-                                buildingid: data.houseList[i].buildingName,
-                                unitid: data.houseList[i].unitName,
-                                roomNumberid: data.houseList[i].roomNumber
-                            });
-                        }
-                    }
-                    this.timePeriod = timePeriodObj;
-                } else {
-                    this.$message.error(msg);
-                }
-            });
+      }
+
+      if (!!this.roomNumber[index]) {
+        this.roomNumber[index] = items.children;
+      } else {
+        this.roomNumber.push(items.children);
+      }
+    },
+    changeInformroomNumber (items) {
+      // if (this.room == 'false') {
+      //     this.formData.FnroomNumberid = [];
+      // }
+      // this.formData.FnroomNumberid.push(items.value);
+    },
+    findUserToggle () {
+      this.formData.username = this.$refs.userName.getCheckedNodes()[0].label;
+    }
+  },
+  created () {
+    this.findUser = this.params.arrData;
+
+    let url = '/sc-community/assets/tree/community/find?buildingType=1';
+    this.$http.get(url).then(({ status, msg, data }) => {
+      if (status == 0) {
+        this.close();
+        this.community = data;
+      } else {
+        this.$message.error(msg);
+      }
+    });
+    if (this.params.todo == 'edit') {
+      console.log(this.params.data);
+      let url = `/sc-community-web/business/find/${this.params.data}`;
+      this.$http.get(url).then(({ status, msg, data }) => {
+        if (status == 0) {
+          this.close();
+          console.log('data', data);
+          this.formData = {
+            name: data.clientName + '',
+            telephon: data.clientPhone + '',
+            customerType: data.clientType,
+            businessOpportunity: data.businessSource,
+            demandType: data.demandSource,
+            intentionLevel: data.intentionGrade,
+            remarks: data.remark + '',
+            userId: data.userId,
+            username: data.username
+          };
+          let timePeriodObj = [];
+          if (data.houseList.length == 0) {
+            timePeriodObj = [
+              {
+                communityid: '',
+                buildingid: '',
+                unitid: '',
+                roomNumberid: ''
+              }
+            ];
+          } else {
+            for (let i = 0; i < data.houseList.length; i++) {
+              timePeriodObj.push({
+                communityid: data.houseList[i].communityName,
+                buildingid: data.houseList[i].buildingName,
+                unitid: data.houseList[i].unitName,
+                roomNumberid: data.houseList[i].roomNumber
+              });
+            }
+          }
+          this.timePeriod = timePeriodObj;
+        } else {
+          this.$message.error(msg);
         }
+      });
     }
+  }
 };
 </script>
+

+ 126 - 108
operationSupport/src/views/businessManagement/opportunityManagement/setpPage/details.vue

@@ -1,60 +1,78 @@
 <template>
-    <div class="lookDetail">
-        <div class="left">
-            <div class="list-item">
-                <div class="formContent-item_title">商机信息</div>
-                <el-form ref="form" label-width="110px">
-                    <template v-for="(item, index) in formLook">
-                        <el-col :span="!!item.span ? item.span : 12" :key="index">
-                            <el-form-item :label="item.label">
-                                <template v-if="item.slot">
-                                    <!-- 意向来源 -->
-                                    <template v-if="item.slot === 'businessSource'">
-                                        <span v-if="thisItem['businessSource'] == 1">线上预约</span>
-                                        <span v-else-if="thisItem['businessSource'] == 2">线上电话</span>
-                                        <span v-else-if="thisItem['businessSource'] == 3">线下访问</span>
-                                        <span v-else>--</span>
-                                    </template>
-                                    <!-- 需求类型 -->
-                                    <template v-if="item.slot === 'demandSource'">
-                                        <span v-if="thisItem['demandSource'] == 1">住宅</span>
-                                        <span v-else-if="thisItem['demandSource'] == 2">商业</span>
-                                        <span v-else>--</span>
-                                    </template>
-                                    <!-- 客户类型 -->
-                                    <template v-if="item.slot === 'clientType'">
-                                        <span v-if="thisItem['clientType'] == 1">个人</span>
-                                        <span v-else-if="thisItem['clientType'] == 2">企业</span>
-                                        <span v-else>--</span>
-                                    </template>
-                                    <!-- 意向等级 -->
-                                    <template v-if="item.slot === 'intentionGrade'">
-                                        <span v-if="thisItem['intentionGrade'] == 1">高</span>
-                                        <span v-else-if="thisItem['intentionGrade'] == 2">中</span>
-                                        <span v-else-if="thisItem['intentionGrade'] == 3">低</span>
-                                        <span v-else>--</span>
-                                    </template>
-                                </template>
-                                <template v-else>{{ thisItem[item.prop] || '--' }}</template>
-                            </el-form-item>
-                        </el-col></template
-                    >
-                </el-form>
+  <div class="lookDetail">
+    <div class="left">
+      <div class="list-item">
+        <div class="formContent-item_title">商机信息</div>
+        <el-form
+          ref="form"
+          label-width="110px"
+        >
+          <template v-for="(item, index) in formLook">
+            <el-col
+              :span="!!item.span ? item.span : 12"
+              :key="index"
+            >
+              <el-form-item :label="item.label">
+                <template v-if="item.slot">
+                  <!-- 意向来源 -->
+                  <template v-if="item.slot === 'businessSource'">
+                    <span v-if="thisItem['businessSource'] == 1">线上预约</span>
+                    <span v-else-if="thisItem['businessSource'] == 2">线上电话</span>
+                    <span v-else-if="thisItem['businessSource'] == 3">线下访问</span>
+                    <span v-else>--</span>
+                  </template>
+                  <!-- 需求类型 -->
+                  <template v-if="item.slot === 'demandSource'">
+                    <span v-if="thisItem['demandSource'] == 1">住宅</span>
+                    <span v-else-if="thisItem['demandSource'] == 2">商业</span>
+                    <span v-else>--</span>
+                  </template>
+                  <!-- 客户类型 -->
+                  <template v-if="item.slot === 'clientType'">
+                    <span v-if="thisItem['clientType'] == 1">个人</span>
+                    <span v-else-if="thisItem['clientType'] == 2">企业</span>
+                    <span v-else>--</span>
+                  </template>
+                  <!-- 意向等级 -->
+                  <template v-if="item.slot === 'intentionGrade'">
+                    <span v-if="thisItem['intentionGrade'] == 0">高</span>
+                    <span v-else-if="thisItem['intentionGrade'] == 1">中</span>
+                    <span v-else-if="thisItem['intentionGrade'] == 2">低</span>
+                    <span v-else>--</span>
+                  </template>
+                </template>
+                <template v-else>{{ thisItem[item.prop] || '--' }}</template>
+              </el-form-item>
+            </el-col>
+          </template>
+        </el-form>
+      </div>
+    </div>
+    <div class="right">
+      <div class="list-item">
+        <div class="formContent-item_title">招商跟进记录</div>
+        <template v-for="(item, index) in thisItem['businessRecordList']">
+          <div
+            class="steps"
+            :key="index"
+          >
+            <div class="steps-left">
+              <img
+                src="@assets/img/point_yiwancheng@2x.png"
+                alt
+              />
+              <div
+                class="steps-left-line"
+                v-if="index !== thisItem['businessRecordList'].length - 1"
+              ></div>
             </div>
-        </div>
-        <div class="right">
-            <div class="list-item">
-                <div class="formContent-item_title">招商跟进记录</div>
-                <template v-for="(item, index) in thisItem['businessRecordList']">
-                    <div class="steps" :key="index">
-                        <div class="steps-left">
-                            <img src="@assets/img/point_yiwancheng@2x.png" alt />
-                            <div class="steps-left-line" v-if="index !== thisItem['businessRecordList'].length - 1"></div>
-                        </div>
-                        <div class="steps-right">
-                            <div class="steps-right-title">
-                                <span>{{ item.createDate }}</span>
-                                <span class="status" v-if="index === thisItem['businessRecordList'].length - 1">{{
+            <div class="steps-right">
+              <div class="steps-right-title">
+                <span>{{ item.createDate }}</span>
+                <span
+                  class="status"
+                  v-if="index === thisItem['businessRecordList'].length - 1"
+                >{{
                                     thisItem.businessStatus == '1'
                                         ? '意向'
                                         : thisItem.businessStatus == '2'
@@ -65,66 +83,66 @@
                                         ? '签订合同'
                                         : '失败'
                                 }}</span>
-                            </div>
-                            <div class="steps-right-content">
-                                <span>招商人:</span>
-                                <span>{{ thisItem['username'] }}</span>
-                            </div>
-                            <div class="steps-right-content">
-                                <span>进度描述:</span>
-                                <span>{{ item.progressDescription }}</span>
-                            </div>
-                        </div>
-                    </div>
-                </template>
+              </div>
+              <div class="steps-right-content">
+                <span>招商人:</span>
+                <span>{{ thisItem['username'] }}</span>
+              </div>
+              <div class="steps-right-content">
+                <span>进度描述:</span>
+                <span>{{ item.progressDescription }}</span>
+              </div>
             </div>
-        </div>
+          </div>
+        </template>
+      </div>
     </div>
+  </div>
 </template>
 
 <script>
 export default {
-    props: ['params'],
-    data() {
-        return {
-            formLook: [
-                { label: '客户信息:', prop: 'clientName' },
-                { label: '客户手机:', prop: 'clientPhone' },
-                {
-                    label: '意向来源:',
-                    prop: 'businessSource',
-                    slot: 'businessSource'
-                },
-                { label: '需求类型:', prop: 'demandSource', slot: 'demandSource' },
-                { label: '客户类型:', prop: 'clientType', slot: 'clientType' },
-                {
-                    label: '意向等级:',
-                    prop: 'intentionGrade',
-                    slot: 'intentionGrade'
-                },
-                { label: '备注:', prop: 'remark' }
-            ],
-            thisItem: {},
-            thisActive: 0
-        };
-    },
-    methods: {
-        getDatali(id) {
-            this.$http
-                .get('/sc-community-web/business/find/' + id)
-                .then(({ data, msg, status }) => {
-                    if (status == 0) {
-                        this.thisItem = data;
-                        this.thisActive = !!data.businessRecordList.length ? Number(data.businessRecordList.length) - 1 : 0;
-                        this.params.callback && this.params.callback();
-                    }
-                })
-                .catch(() => {});
-        }
-    },
-    created() {
-        this.getDatali(this.params.id);
+  props: ['params'],
+  data () {
+    return {
+      formLook: [
+        { label: '客户信息:', prop: 'clientName' },
+        { label: '客户手机:', prop: 'clientPhone' },
+        {
+          label: '意向来源:',
+          prop: 'businessSource',
+          slot: 'businessSource'
+        },
+        { label: '需求类型:', prop: 'demandSource', slot: 'demandSource' },
+        { label: '客户类型:', prop: 'clientType', slot: 'clientType' },
+        {
+          label: '意向等级:',
+          prop: 'intentionGrade',
+          slot: 'intentionGrade'
+        },
+        { label: '备注:', prop: 'remark' }
+      ],
+      thisItem: {},
+      thisActive: 0
+    };
+  },
+  methods: {
+    getDatali (id) {
+      this.$http
+        .get('/sc-community-web/business/find/' + id)
+        .then(({ data, msg, status }) => {
+          if (status == 0) {
+            this.thisItem = data;
+            this.thisActive = !!data.businessRecordList.length ? Number(data.businessRecordList.length) - 1 : 0;
+            this.params.callback && this.params.callback();
+          }
+        })
+        .catch(() => { });
     }
+  },
+  created () {
+    this.getDatali(this.params.id);
+  }
 };
 </script>
 <style lang="scss" scoped>