Bladeren bron

格式化

qymljy 1 jaar geleden
bovenliggende
commit
badbd06f8d

+ 30 - 30
src/Form/accountclass/add.vue

@@ -1,12 +1,12 @@
 <template>
   <div>
     <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 建</el-button>
-    <el-dialog title="新 建" append-to-body :visible.sync="dialogFormVisible" width="500px">
+    <el-dialog :visible.sync="dialogFormVisible" append-to-body title="新 建" width="500px">
       <div slot="title" style="font-size: 15px">
         新增账户类型
       </div>
       <el-row :gutter="20">
-        <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
+        <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="90px" size="mini">
           <el-col :span="24">
             <el-form-item label="账户编号" prop="accountno">
               <el-input v-model="form.accountno" placeholder="账户编号"></el-input>
@@ -19,24 +19,24 @@
           </el-col>
           <el-col :span="6">
             <el-form-item>
-              <el-checkbox :true-label="1" :false-label="0" v-model="form.isrebate">是否返利账户</el-checkbox>
+              <el-checkbox v-model="form.isrebate" :false-label="0" :true-label="1">是否返利账户</el-checkbox>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item  >
-              <el-checkbox :true-label="1" :false-label="0" v-model="form.isorder" checked="checked">允许订货</el-checkbox>
+            <el-form-item>
+              <el-checkbox v-model="form.isorder" :false-label="0" :true-label="1" checked="checked">允许订货</el-checkbox>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item  >
-              <el-checkbox :true-label="1" :false-label="0" v-model="form.isused" checked="checked">是否启用</el-checkbox>
+            <el-form-item>
+              <el-checkbox v-model="form.isused" :false-label="0" :true-label="1" checked="checked">是否启用</el-checkbox>
             </el-form-item>
           </el-col>
         </el-form>
       </el-row>
       <div class="dialog-footer">
-        <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
+        <el-button class="normal-btn-width" size="small" @click="dialogFormVisible = false">取 消</el-button>
+        <el-button class="normal-btn-width btn-warning" size="small" type="warning" @click="onSubmit">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -45,40 +45,40 @@
 <script>
 export default {
   name: "add",
-  data(){
+  data() {
     return {
-      dialogFormVisible:false,
-      isordercheck:true,
-      isusedcheck:false,
-      form:{
-        sa_accountclassid:0,
-        accountno:'',
-        accountname:'',
-        isorder:'',
-        isused:0,
-        isrebate:0
+      dialogFormVisible: false,
+      isordercheck: true,
+      isusedcheck: false,
+      form: {
+        sa_accountclassid: 0,
+        accountno: '',
+        accountname: '',
+        isorder: '',
+        isused: 0,
+        isrebate: 0
       },
-      rules:{
-        accountno:[
-          { required: true, message: '输入账户编号', trigger: 'blur'},
+      rules: {
+        accountno: [
+          {required: true, message: '输入账户编号', trigger: 'blur'},
         ],
-        accountname:[
-          { required: true, message: '输入账户名称', trigger: 'blur'}
+        accountname: [
+          {required: true, message: '输入账户名称', trigger: 'blur'}
         ]
       }
     }
   },
-  methods:{
-    onSubmit(){
+  methods: {
+    onSubmit() {
       console.log(this.form)
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false
         const res = await this.$api.requested({
           "id": "20221008134703",
-          "version":1,
+          "version": 1,
           "content": this.form
         })
-        this.tool.showMessage(res,()=>{
+        this.tool.showMessage(res, () => {
           this.$emit('onSuccess')
           this.$refs['form'].resetFields();
           this.dialogFormVisible = false
@@ -93,4 +93,4 @@ export default {
 .dialog-footer {
   margin-top: 0;
 }
-</style>
+</style>

+ 245 - 213
src/Form/salerPrivatecustomer/add.vue

@@ -2,30 +2,31 @@
   <div>
     <el-button size="small" type="primary" @click="show">新 建</el-button>
     <el-drawer
-        title="新建客户"
-        :visible.sync="dialogFormVisible"
-        size="600px"
-        direction="rtl"
         :show-close="false"
+        :visible.sync="dialogFormVisible"
         append-to-body
+        direction="rtl"
+        size="600px"
+        title="新建客户"
         @close="onClose">
       <div class="drawer__panel">
         <el-row :gutter="20">
-          <el-form :model="form" :rules="rules" ref="form" label-width="100px" label-position="right" size="mini">
+          <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="100px" size="mini">
             <el-col :span="20">
               <el-form-item label="客户名称:" prop="enterprisename">
                 <el-input v-model="form.enterprisename" placeholder="请输入客户名称" style="width: 100%"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessInquiry ref="businessRef" @businessData="businessSelect" :keyword="form.enterprisename"></businessInquiry>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="企业简称:" prop="abbreviation">
                 <el-input v-model="form.abbreviation" placeholder="请输入企业简称" style="width: 100%"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="24" >
+            <el-col :span="24">
               <el-form-item label="客户类型:" prop="type">
                 <el-select v-model="form.type" placeholder="请选择客户类型" style="width: 100%">
                   <el-option
@@ -34,7 +35,9 @@
                       :label="item.value"
                       :value="item.value">
                     <span style="float: left">{{ item.value }}</span>
-                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
+                    <span style="float: right; color: #8492a6; font-size: 12px">{{
+                        item.remarks ? item.remarks : '暂无描述'
+                      }}</span>
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -48,7 +51,9 @@
                       :label="item.value "
                       :value="item.value">
                     <span style="float: left">{{ item.value }}</span>
-                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
+                    <span style="float: right; color: #8492a6; font-size: 12px">{{
+                        item.remarks ? item.remarks : '暂无描述'
+                      }}</span>
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -62,20 +67,22 @@
                       :label="item.value "
                       :value="item.value">
                     <span style="float: left">{{ item.value }}</span>
-                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
+                    <span style="float: right; color: #8492a6; font-size: 12px">{{
+                        item.remarks ? item.remarks : '暂无描述'
+                      }}</span>
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item  label="客户行业:" prop="industry">
+              <el-form-item label="客户行业:" prop="industry">
                 <el-select
                     ref="sle"
-                    style="width:100%;"
                     v-model="form.industry"
                     multiple
                     placeholder="请选择所属行业"
                     size="mini"
+                    style="width:100%;"
                 >
                   <el-option
                       v-for="item in options.industryData"
@@ -84,36 +91,43 @@
                       :value="item.value"
                   >
                     <span style="float: left">{{ item.value }}</span>
-                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
+                    <span style="float: right; color: #8492a6; font-size: 12px">{{
+                        item.remarks ? item.remarks : '暂无描述'
+                      }}</span>
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item label="联系人:"  prop="contactsinfo.name">
-                <contactsNewTemplate ownertable="sys_enterprise" :ownerid="0" :name="form.contactsinfo.name" @contactData="contactData" @inputChange="inputChange" placement="left-start"></contactsNewTemplate>
+              <el-form-item label="联系人:" prop="contactsinfo.name">
+                <contactsNewTemplate :name="form.contactsinfo.name" :ownerid="0" ownertable="sys_enterprise"
+                                     placement="left-start" @contactData="contactData"
+                                     @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
 
-            <el-col :span="24" v-if="isPhone">
+            <el-col v-if="isPhone" :span="24">
               <el-form-item label="联系方式:" prop="contactsinfo.phonenumber">
                 <el-button-group>
                   <el-radio v-model="isPhone" :label="true" @change="phoneChang('手机')">手机号</el-radio>
                   <el-radio v-model="isPhone" :label="false" @change="phoneChang('座机')">座机电话</el-radio>
                 </el-button-group>
-                <el-input v-model="form.contactsinfo.phonenumber" placeholder="请输入手机号" style="width: 100%;margin-top: 10px" @input="telephoneChange('手机')"></el-input>
+                <el-input v-model="form.contactsinfo.phonenumber" placeholder="请输入手机号"
+                          style="width: 100%;margin-top: 10px" @input="telephoneChange('手机')"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="24" v-if="!isPhone">
+            <el-col v-if="!isPhone" :span="24">
               <el-form-item label="联系方式:" prop="contactsinfo.telephone">
                 <el-button-group>
                   <el-radio v-model="isPhone" :label="true" @change="phoneChang('手机')">手机号</el-radio>
                   <el-radio v-model="isPhone" :label="false" @change="phoneChang('座机')">座机电话</el-radio>
                 </el-button-group>
                 <div style="width: 100%">
-                  <el-input v-model="areaCode" placeholder="请输入区号" style="width:25%;margin-top: 10px" @input="telephoneChange('座机')"></el-input>
+                  <el-input v-model="areaCode" placeholder="请输入区号" style="width:25%;margin-top: 10px"
+                            @input="telephoneChange('座机')"></el-input>
                   <span style="color: #999999">——</span>
-                  <el-input v-model="telephone" placeholder="请输入座机电话" style="width:68%;margin-top: 10px" @input="telephoneChange('座机')"></el-input>
+                  <el-input v-model="telephone" placeholder="请输入座机电话" style="width:68%;margin-top: 10px"
+                            @input="telephoneChange('座机')"></el-input>
                 </div>
               </el-form-item>
             </el-col>
@@ -136,10 +150,10 @@
             <el-col :span="24">
               <el-form-item label="省市县:" prop="province">
                 <el-cascader
-                    style="width: 100%"
                     v-model="value"
                     :options="basicData.data().areaData"
-                    @change="cascaderChange" clearable>
+                    clearable
+                    style="width: 100%" @change="cascaderChange">
                 </el-cascader>
               </el-form-item>
             </el-col>
@@ -152,57 +166,66 @@
             <el-col :span="24">
               <el-form-item label="上级企业:" prop="superiorenterprisename">
                 <el-popover
+                    v-model="customerShow"
                     placement="bottom"
-                    width="700"
                     trigger="click"
-                    v-model="customerShow"
+                    width="700"
                     @show="customerList">
                   <el-input
-                      style="width:300px;margin-bottom: 10px"
-                      placeholder="请输入内容"
                       v-model="customerParam.content.where.condition"
                       clearable
-                      @clear="customerList(customerParam.content.pageNumber = 1)"
+                      placeholder="请输入内容"
                       size="mini"
+                      style="width:300px;margin-bottom: 10px"
+                      @clear="customerList(customerParam.content.pageNumber = 1)"
                       @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
-                    <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
+                    <i slot="prefix" class="el-icon-search"
+                       @click="customerList(customerParam.content.pageNumber = 1)"></i>
                   </el-input>
-                  <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                  <el-table :data="customer.customerData" :header-cell-style="{background:'#EEEEEE',color:'#333'}"
+                            height="396px"
+                            size="mini" @row-click="customerData">
                     <el-table-column
                         label="客户编号"
                         width="100">
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                        <span style="margin-left: 10px">{{
+                            scope.row.sa_customersid ? scope.row.sa_customersid : '--'
+                          }}</span>
                       </template>
                     </el-table-column>
                     <el-table-column
                         label="客户名称"
                         width="260">
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
+                        <span
+                            style="margin-left: 10px">{{
+                            scope.row.enterprisename ? scope.row.enterprisename : '--'
+                          }}</span>
                       </template>
                     </el-table-column>
                     <el-table-column
                         label="地址"
                     >
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                        <span style="margin-left: 10px">{{ scope.row.address ? scope.row.address : '--' }}</span>
                       </template>
                     </el-table-column>
                   </el-table>
                   <div class="container normal-panel" style="text-align:right">
                     <el-pagination
+                        :current-page="customer.currentPage"
+                        :page-sizes="[20,50,100,]"
+                        :total="customer.total"
                         background
+                        layout="total,sizes, prev, pager, next, jumper"
                         small
                         @size-change="handleSizeChangeCustomer"
-                        @current-change="handleCurrentChangeCustomer"
-                        :page-sizes="[20,50,100,]"
-                        layout="total,sizes, prev, pager, next, jumper"
-                        :current-page="customer.currentPage"
-                        :total="customer.total">
+                        @current-change="handleCurrentChangeCustomer">
                     </el-pagination>
                   </div>
-                  <el-input slot="reference" :readonly="true" v-model="form.superiorenterprisename" autocomplete="off" placeholder="请选择客户"  @input="selectCustomer"></el-input>
+                  <el-input slot="reference" v-model="form.superiorenterprisename" :readonly="true" autocomplete="off"
+                            placeholder="请选择客户" @input="selectCustomer"></el-input>
                 </el-popover>
               </el-form-item>
             </el-col>
@@ -214,57 +237,64 @@
             <el-col :span="24">
               <el-form-item label="归属经销商:" prop="sa_agentsid">
                 <el-popover
+                    v-model="agentsShow"
                     placement="bottom"
-                    width="700"
                     trigger="click"
-                    v-model="agentsShow"
+                    width="700"
                     @show="queryAgents">
                   <el-input
-                      style="width:300px;margin-bottom: 10px"
-                      placeholder="请输入内容"
                       v-model="agentsParam.content.where.condition"
                       clearable
-                      @clear="queryAgents(agentsParam.content.pageNumber = 1)"
+                      placeholder="请输入内容"
                       size="mini"
+                      style="width:300px;margin-bottom: 10px"
+                      @clear="queryAgents(agentsParam.content.pageNumber = 1)"
                       @keyup.enter.native="queryAgents(agentsParam.content.pageNumber = 1)">
-                    <i slot="prefix" class="el-icon-search" @click="queryAgents(agentsParam.content.pageNumber = 1)"></i>
+                    <i slot="prefix" class="el-icon-search"
+                       @click="queryAgents(agentsParam.content.pageNumber = 1)"></i>
                   </el-input>
-                  <el-table :data="agents.agentsData" @row-click="agentsData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                  <el-table :data="agents.agentsData" :header-cell-style="{background:'#EEEEEE',color:'#333'}"
+                            height="396px"
+                            size="mini" @row-click="agentsData">
                     <el-table-column
                         label="经销商编码"
                         width="100">
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.agentnum?scope.row.agentnum:'--' }}</span>
+                        <span style="margin-left: 10px">{{ scope.row.agentnum ? scope.row.agentnum : '--' }}</span>
                       </template>
                     </el-table-column>
                     <el-table-column
                         label="经销商名称"
                         width="260">
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
+                        <span
+                            style="margin-left: 10px">{{
+                            scope.row.enterprisename ? scope.row.enterprisename : '--'
+                          }}</span>
                       </template>
                     </el-table-column>
                     <el-table-column
                         label="地址"
                     >
                       <template slot-scope="scope">
-                        <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
+                        <span style="margin-left: 10px">{{ scope.row.address ? scope.row.address : '--' }}</span>
                       </template>
                     </el-table-column>
                   </el-table>
                   <div class="container normal-panel" style="text-align:right">
                     <el-pagination
+                        :current-page="agents.currentPage"
+                        :page-sizes="[20,50,100,]"
+                        :total="agents.total"
                         background
+                        layout="total,sizes, prev, pager, next, jumper"
                         small
                         @size-change="handleSizeChangeAgent"
-                        @current-change="handleCurrentChangeAgent"
-                        :page-sizes="[20,50,100,]"
-                        layout="total,sizes, prev, pager, next, jumper"
-                        :current-page="agents.currentPage"
-                        :total="agents.total">
+                        @current-change="handleCurrentChangeAgent">
                     </el-pagination>
                   </div>
-                  <el-input slot="reference" :readonly="true" v-model="form.agentname" autocomplete="off" placeholder="请选择经销商"  @input="selectAgents"></el-input>
+                  <el-input slot="reference" v-model="form.agentname" :readonly="true" autocomplete="off"
+                            placeholder="请选择经销商" @input="selectAgents"></el-input>
                 </el-popover>
               </el-form-item>
             </el-col>
@@ -272,16 +302,17 @@
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
-        <duplicateCheck ref="check" :data="form" @onSuccess="onClose" @onCheck="onCheck"></duplicateCheck>
-        <el-button size="small" type="primary" :loading="loading" @click="onSave" class="normal-btn-width">确 定</el-button>
+        <el-button class="normal-btn-width inline-16" size="small" @click="onClose">取 消</el-button>
+        <duplicateCheck ref="check" :data="form" @onCheck="onCheck" @onSuccess="onClose"></duplicateCheck>
+        <el-button :loading="loading" class="normal-btn-width" size="small" type="primary" @click="onSave">确 定
+        </el-button>
       </div>
     </el-drawer>
     <enterprise
-        :visible="visibleEnterprise"
+        v-if="visibleEnterprise"
         :index="index"
         :sa_projectid="form.sa_projectid"
-        v-if="visibleEnterprise"
+        :visible="visibleEnterprise"
         @onEnterprise="onEnterprise">
     </enterprise>
   </div>
@@ -295,118 +326,119 @@ import enterprise from '@/SDrpManagement/salerPrivatecustomer/components/enterpr
 import duplicateCheck from "@/components/duplicatesCheck/customerCheck";
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
 import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
   name: "add",
-  components:{enterprise,duplicateCheck,contactsNewTemplate,businessInquiry},
-  data(){
+  components: {enterprise, duplicateCheck, contactsNewTemplate, businessInquiry},
+  data() {
     return {
-      activeName:'first',
-      dialogFormVisible:false,
-      visibleEnterprise:false,
-      customerShow:false,
-      checkResults:'',
-      index:'',
-      businessData:[],
-      businessParam:{
+      activeName: 'first',
+      dialogFormVisible: false,
+      visibleEnterprise: false,
+      customerShow: false,
+      checkResults: '',
+      index: '',
+      businessData: [],
+      businessParam: {
         "id": 20221208103601,
         "content": {
-          "pageNumber":1,
-          "pageSize":5,
-          "keyword":''
+          "pageNumber": 1,
+          "pageSize": 5,
+          "keyword": ''
         },
       },
 
-      businessShow:false,
-      total:0,
-      currentPage:0,
-      form:{
+      businessShow: false,
+      total: 0,
+      currentPage: 0,
+      form: {
         sa_customersid: 0,//新增是传0
         parentid: 0, //上级客户ID,默认或没有上级的时候传0
         sys_enterpriseid: 0, //合作企业档案ID,新增是传0,更新
-        enterprisename:"",//客户名称(企业名称)
+        enterprisename: "",//客户名称(企业名称)
         type: "", //客户类型
         source: "", //客户来源
-        province:"",//非必填,可选
-        city:"",//非必填,可选
-        county:"",//非必填,可选
-        address:"",//非必填,可选
-        abbreviation:"",//非必填,可选
-        taxno:"",//税号,非必填,可选
-        grade:'',// 客户等级(商户等级)
-        industry:[],//非必填,可选,所属行业
-        contact:"",//非必填,可选
-        phonenumber:"",//非必填,可选
-        customergrade:"",
-        ispublic:0,//1:公海客户,0:私域客户,自己新建的
+        province: "",//非必填,可选
+        city: "",//非必填,可选
+        county: "",//非必填,可选
+        address: "",//非必填,可选
+        abbreviation: "",//非必填,可选
+        taxno: "",//税号,非必填,可选
+        grade: '',// 客户等级(商户等级)
+        industry: [],//非必填,可选,所属行业
+        contact: "",//非必填,可选
+        phonenumber: "",//非必填,可选
+        customergrade: "",
+        ispublic: 0,//1:公海客户,0:私域客户,自己新建的
         telephone: "",
         sa_agentsid: "",
-        erpagentnum:"",
-        agentname:'',
+        erpagentnum: "",
+        agentname: '',
         contactsinfo: {
           name: "",
           telephone: "",
           phonenumber: "",
-          sys_phonebookid:0
+          sys_phonebookid: 0
         },
       },
-      value:[],
-      options:{
-        type:[],
-        parentCustomers:[],
-      /*  gradeData:[],*/
-        customerGrade:[],
-        industryData:[],
-        customerClassification:[],
-        distributor:[]
+      value: [],
+      options: {
+        type: [],
+        parentCustomers: [],
+        /*  gradeData:[],*/
+        customerGrade: [],
+        industryData: [],
+        customerClassification: [],
+        distributor: []
       },
-      rules:{
+      rules: {
         enterprisename: [
-          { required: true, message: '请输入客户名称', trigger: 'change,blur' },
+          {required: true, message: '请输入客户名称', trigger: 'change,blur'},
         ],
         type: [
-          { required: true, message: '还未选择客户类型', trigger: 'change' },
+          {required: true, message: '还未选择客户类型', trigger: 'change'},
         ],
         contact: [
-          { required: false, message: '请输入法人', trigger: 'change' },
+          {required: false, message: '请输入法人', trigger: 'change'},
         ],
         telephone: [
-          { required: false, message: '请输入联系电话', trigger: 'change' },
+          {required: false, message: '请输入联系电话', trigger: 'change'},
           /*{ pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'change' }*/
         ],
         province: [
-          { required: true, message: '请选择省市县', trigger: 'blur' },
+          {required: true, message: '请选择省市县', trigger: 'blur'},
         ],
-        'contactsinfo.name':[
-            { required: true, message: '请输入联系人姓名', trigger: 'change,blur' }
+        'contactsinfo.name': [
+          {required: true, message: '请输入联系人姓名', trigger: 'change,blur'}
         ],
         'contactsinfo.phonenumber': [
-          { required: true, message: '请输入联系电话', trigger: 'change' },
-          { pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'change' }
+          {required: true, message: '请输入联系电话', trigger: 'change'},
+          {pattern: /^1[3-9]\d{9}$/, message: '请输入正确手机号码', trigger: 'change'}
         ],
         'contactsinfo.telephone': [
-          { required: true, message: '请输入座机电话', trigger: 'change' },
-          { pattern:/^0\d{2,3}-\d{7,8}$/, message: '请输入正确座机电话',trigger: 'change' }
+          {required: true, message: '请输入座机电话', trigger: 'change'},
+          {pattern: /^0\d{2,3}-\d{7,8}$/, message: '请输入正确座机电话', trigger: 'change'}
         ],
       },
-      customerParam:{
+      customerParam: {
         "id": 20220920083901,
         "content": {
           "pageNumber": 1,
           "pageSize": 20,
           "where": {
             "condition": "",
-            "type":2,
-            "sa_projectid":""
+            "type": 2,
+            "sa_projectid": ""
           }
         }
       },
-      customer:{
-        customerData:[],
-        total:0,
-        currentPage:0,
+      customer: {
+        customerData: [],
+        total: 0,
+        currentPage: 0,
       },
-      agentsShow:false,
-      agentsParam:{
+      agentsShow: false,
+      agentsParam: {
         "id": 20230214162602,
         "content": {
           "hrid": '',
@@ -417,14 +449,14 @@ export default {
           }
         }
       },
-      agents:{
-        agentsData:[],
-        total:0,
-        currentPage:0,
+      agents: {
+        agentsData: [],
+        total: 0,
+        currentPage: 0,
       },
-      isPhone:true,
-      enterpriseContact:{
-        param:{
+      isPhone: true,
+      enterpriseContact: {
+        param: {
           "content": {
             "sys_enterpriseid": '',
             "pageNumber": 1,
@@ -435,41 +467,41 @@ export default {
           },
           "id": 20221219193002,
         },
-        listData:[],
-        total:0,
-        currentPage:0,
-        show:false
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false
       },
-      myContacts:{
-        param:{
+      myContacts: {
+        param: {
           "id": 20221219161202,
           "content": {
             "pageNumber": 1,
             "pageSize": 9999,
-            "ownertable":'sa_customers',
-            "ownerid":'',
+            "ownertable": 'sa_customers',
+            "ownerid": '',
             "where": {
               "condition": ""
             }
           }
         },
-        listData:[],
-        total:0,
-        currentPage:0,
-        show:false
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false
       },
-      areaCode:'',
-      telephone:''
+      areaCode: '',
+      telephone: ''
     }
   },
-  computed:{
+  computed: {
     ...mapGetters({
-      dataToForm:'dataToForm',
-      loading:'loading'
+      dataToForm: 'dataToForm',
+      loading: 'loading'
     })
   },
-  methods:{
-    show(){
+  methods: {
+    show() {
       this.form.agentname = ''
       this.form.sa_agentsid = ''
       this.dialogFormVisible = true
@@ -481,7 +513,7 @@ export default {
       this.enterpriseContactList()
     },
     /*选择工商信息*/
-    businessSelect(val,regProvince){
+    businessSelect(val, regProvince) {
       this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -491,7 +523,7 @@ export default {
         this.form.enterprisename = val.companyName
         this.form.address = val.address === "-" ? '' : val.address
         this.form.taxno = val.taxNum
-        this.value = [regProvince,val.regCity,val.regArea]
+        this.value = [regProvince, val.regCity, val.regArea]
         this.form.province = regProvince
         this.form.city = val.regCity
         this.form.county = val.regArea
@@ -506,47 +538,47 @@ export default {
       })
     },
     /*查重检查*/
-    onCheck(){
+    onCheck() {
       this.$refs.form.validate((valid) => {
         if (!valid) return false
         this.$refs.check.queryRule()
       })
     },
     /*自动查重判断*/
-    duplicateCheck(){
+    duplicateCheck() {
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
         const res = await this.$api.requested({
           "id": 20221208172002,
           "content": {
-            "sa_customersid":this.form.sa_customersid,
-            "enterprisename":this.form.enterprisename,
-            "taxno":this.form.taxno,
-            "address":this.form.address
+            "sa_customersid": this.form.sa_customersid,
+            "enterprisename": this.form.enterprisename,
+            "taxno": this.form.taxno,
+            "address": this.form.address
           },
         })
-        console.log(res,"查重结果")
-        if (res.data.length !== 0){
+        console.log(res, "查重结果")
+        if (res.data.length !== 0) {
           console.log("重复")
         }
         this.checkResults = res.data.length
         this.onSave()
       })
     },
-    onSave(){
-     this.$refs.form.validate((valid) => {
-       if (!valid) return false
-       this.$refs.check.creatShow = true
-       this.$store.commit('setLoading',true)
-       this.$refs.check.queryRule(() => {
-        this.$store.commit('setLoading',false)
-       })
-     })
-    },
-    onClose () {
+    onSave() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) return false
+        this.$refs.check.creatShow = true
+        this.$store.commit('setLoading', true)
+        this.$refs.check.queryRule(() => {
+          this.$store.commit('setLoading', false)
+        })
+      })
+    },
+    onClose() {
       this.form.contactsinfo.telephone = ''
       this.form.contactsinfo.phonenumber = ''
-      this.form.contactsinfo.sys_phonebookid  = 0
+      this.form.contactsinfo.sys_phonebookid = 0
       this.form.agentname = ''
       this.form.sa_agentsid = ''
       this.isPhone = true
@@ -560,7 +592,7 @@ export default {
       this.$emit('onSuccess')
     },
     /*客户类型列表*/
-    async typeList(){
+    async typeList() {
       const siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
       const res = await this.$api.requested({
         "classname": "sysmanage.develop.optiontype.optiontype",
@@ -576,18 +608,18 @@ export default {
       })
       this.options.type = res.data
     },
-    async customerList(){
+    async customerList() {
       const res = await this.$api.requested(this.customerParam)
       this.customer.customerData = res.data
       this.customer.total = res.total
       this.customer.currentPage = res.pageNumber
     },
-    selectCustomer(){
+    selectCustomer() {
       this.customerParam.content.where.condition = this.form.enterprisename
       this.customerList()
     },
     /*客户选择信息*/
-    customerData(val){
+    customerData(val) {
       this.form.parentid = val.sa_customersid
       this.form.superiorenterprisename = val.enterprisename
       this.customerShow = false
@@ -603,28 +635,28 @@ export default {
       this.customerParam.content.pageNumber = val
       this.customerList()
     },
-    enterpriseList(){
+    enterpriseList() {
 
       this.visibleEnterprise = true
     },
     /*上级客户列表*/
-    onEnterprise(data){
+    onEnterprise(data) {
       this.visibleEnterprise = false
       this.form.parentid = data.sa_customersid
       this.form.superiorenterprisename = data.enterprisename
 
     },
     /*省市县*/
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val[0]
       if (val.length === 1)
-        return this.form = Object.assign({},this.form,{province:val[0],city:'',county:''})
+        return this.form = Object.assign({}, this.form, {province: val[0], city: '', county: ''})
 
-      this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
+      this.form = Object.assign({}, this.form, {province: val[0], city: val[1], county: val[2]})
       this.$refs.form.validateField('province')
     },
     /*客户分类*/
-    async gradeList(){
+    async gradeList() {
       const siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
       const res = await this.$api.requested({
         "classname": "sysmanage.develop.optiontype.optiontype",
@@ -641,13 +673,13 @@ export default {
       this.options.customerClassification = res.data
     },
     /*客户等级*/
-    queryCustomerGrade(){
-      this.$store.dispatch('optiontypeselect','agentgrade').then(res=>{
+    queryCustomerGrade() {
+      this.$store.dispatch('optiontypeselect', 'agentgrade').then(res => {
         this.options.customerGrade = res.data
       })
     },
     /*行业列表*/
-    async industryList(){
+    async industryList() {
       const siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
       const res = await this.$api.requested({
         "classname": "sysmanage.develop.optiontype.optiontype",
@@ -664,7 +696,7 @@ export default {
       this.options.industryData = res.data
     },
     /*所属经销商*/
-    async queryAgents(){
+    async queryAgents() {
       var sessionData = sessionStorage.getItem('active_account')
       this.agentsParam.content.hrid = JSON.parse(sessionData).hrid
       const res = await this.$api.requested(this.agentsParam)
@@ -672,12 +704,12 @@ export default {
       this.agents.total = res.total
       this.agents.currentPage = res.pageNumber
     },
-    selectAgents(){
+    selectAgents() {
       this.agentsParam.content.where.condition = this.form.agentname
       this.queryAgents()
     },
     /*客户选择信息*/
-    agentsData(val){
+    agentsData(val) {
       this.form.sa_agentsid = val.sa_agentsid
       this.form.agentname = val.enterprisename
       this.agentsShow = false
@@ -693,22 +725,22 @@ export default {
       this.agentsParam.content.pageNumber = val
       this.queryAgents()
     },
-    phoneChang(val){
-      if (val === '座机'){
+    phoneChang(val) {
+      if (val === '座机') {
         this.isPhone = false
-      }else {
+      } else {
         this.isPhone = true
       }
     },
-    searchData(){
+    searchData() {
       this.changeTab()
     },
-    changeTab(){
+    changeTab() {
       this.enterpriseContactList()
       this.myContactList()
     },
     /*企业联系人*/
-    async enterpriseContactList(){
+    async enterpriseContactList() {
       this.enterpriseContact.param.content.where.condition = this.form.contactsinfo.name
       this.enterpriseContact.param.content.sys_enterpriseid = 0
       const res = await this.$api.requested(this.enterpriseContact.param)
@@ -717,16 +749,16 @@ export default {
       this.enterpriseContact.currentPage = res.pageNumber
     },
     /*选择企业联系人*/
-    enterpriseContactSelect(val){
+    enterpriseContactSelect(val) {
       this.form.contactsinfo.oldcontactsid = val.contactsid
       this.form.contactsinfo.name = val.name
-      if (val.phonenumber.indexOf('-') != '-1'){
+      if (val.phonenumber.indexOf('-') != '-1') {
         this.isPhone = false
-        this.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
-        this.telephone = val.phonenumber.substring(this.areaCode.length+1)
+        this.areaCode = val.phonenumber.substring(0, val.phonenumber.indexOf('-'))
+        this.telephone = val.phonenumber.substring(this.areaCode.length + 1)
         this.form.contactsinfo.telephone = this.areaCode + '-' + this.telephone
         this.form.contactsinfo.phonenumber = ''
-      }else {
+      } else {
         this.isPhone = true
         this.form.contactsinfo.phonenumber = val.phonenumber
         this.form.contactsinfo.telephone = ''
@@ -746,7 +778,7 @@ export default {
       this.enterpriseContactList()
     },
     /*我的联系人*/
-    async myContactList(){
+    async myContactList() {
       this.myContacts.param.content.where.condition = this.form.contactsinfo.name
       this.myContacts.param.content.sys_enterpriseid = 0
       this.myContacts.param.content.ownerid = 0
@@ -757,16 +789,16 @@ export default {
       this.myContacts.currentPage = res.pageNumber
     },
     /*选择我的联系人*/
-    myContactSelect(val){
+    myContactSelect(val) {
       this.form.contactsinfo.oldcontactsid = 0
       this.form.contactsinfo.name = val.name
-      if (val.phonenumber.indexOf('-') != '-1'){
+      if (val.phonenumber.indexOf('-') != '-1') {
         this.isPhone = false
-        this.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
-        this.telephone = val.phonenumber.substring(this.areaCode.length+1)
+        this.areaCode = val.phonenumber.substring(0, val.phonenumber.indexOf('-'))
+        this.telephone = val.phonenumber.substring(this.areaCode.length + 1)
         this.form.contactsinfo.telephone = this.areaCode + '-' + this.telephone
         this.form.contactsinfo.phonenumber = ''
-      }else {
+      } else {
         this.isPhone = true
         this.form.contactsinfo.phonenumber = val.phonenumber
         this.form.contactsinfo.telephone = ''
@@ -783,29 +815,29 @@ export default {
       this.myContacts.param.content.pageNumber = val
       this.myContactList()
     },
-    telephoneChange(val){
-      if (val === '座机'){
+    telephoneChange(val) {
+      if (val === '座机') {
         this.form.contactsinfo.phonenumber = ''
         this.form.contactsinfo.telephone = this.areaCode + '-' + this.telephone
-      }else {
+      } else {
         this.form.contactsinfo.telephone = ''
         this.areaCode = ''
         this.telephone = ''
       }
     },
-    inputChange(val){
+    inputChange(val) {
       this.form.contactsinfo.name = val
     },
-    contactData(val){
+    contactData(val) {
       this.form.contactsinfo.name = val.name
       this.form.contactsinfo.sys_phonebookid = val.sys_phonebookid
-      if (val.phonenumber.indexOf('-') != '-1'){
+      if (val.phonenumber.indexOf('-') != '-1') {
         this.isPhone = false
-        this.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
-        this.telephone = val.phonenumber.substring(this.areaCode.length+1)
+        this.areaCode = val.phonenumber.substring(0, val.phonenumber.indexOf('-'))
+        this.telephone = val.phonenumber.substring(this.areaCode.length + 1)
         this.form.contactsinfo.telephone = this.areaCode + '-' + this.telephone
         this.form.contactsinfo.phonenumber = ''
-      }else {
+      } else {
         this.isPhone = true
         this.form.contactsinfo.phonenumber = val.phonenumber
         this.form.contactsinfo.telephone = ''
@@ -816,7 +848,7 @@ export default {
 </script>
 
 <style scoped>
-/deep/.el-input__prefix {
+/deep/ .el-input__prefix {
   display: flex;
   align-items: center;
 }

+ 9 - 8
src/HDrpManagement/projectChange/modules/modules/quotation/modules/add.vue

@@ -11,23 +11,23 @@
         @close="onClose">
       <div class="drawer__panel" style="margin-bottom: 0px">
         <el-row style="margin-top: 10px" :gutter="10">
-          <el-form :model="form" :rules="rules" ref="form"  size="mini" label-position="right">
+          <el-form ref="form" :model="form" :rules="rules" label-position="right" size="mini">
             <el-col :span="24">
-              <el-form-item label="报价类型:" label-width="100px" >
+              <el-form-item label="报价类型:" label-width="100px">
                 <el-input v-model="form.type" autocomplete="off" placeholder="报价类型" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="24" >
+            <el-col :span="24">
               <el-form-item label="项目名称:" label-width="100px" prop="projectname">
-                <el-input  disabled  v-model="form.projectname" autocomplete="off" placeholder="请选择项目"   ></el-input>
+                <el-input v-model="form.projectname" autocomplete="off" disabled placeholder="请选择项目"></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="24" >
-              <el-form-item label="项目编号:" label-width="100px" >
-                <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
+            <el-col :span="24">
+              <el-form-item label="项目编号:" label-width="100px">
+                <el-input v-model="form.projectnum" autocomplete="off" disabled placeholder="项目编号"></el-input>
               </el-form-item>
             </el-col>
-            <el-col  :span="24">
+            <el-col :span="24">
               <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
                 <el-popover
                     placement="bottom"
@@ -188,6 +188,7 @@
 <script>
 import quotedPriceProduct from '@/SDrpManagement/QuotedPrice/components/quotedPriceProduct'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index1'
+
 export default {
   name: "add",
   props:["data","flagTag"],