| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445 | <template>  <div class="borderless">    <div class="customer-head">      <div class="customer-back">        <!--        <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"          @click="backToList">返回列表        </el-button>      </div>      <div class="add-customer-btn">        <el-button type="primary" @click="synchronization" size="small" :disabled="!form.id">同 步        </el-button>        <el-button type="primary" @click="openFlow" size="small" :disabled="!form.id">审 核        </el-button>        <el-button type="primary" :disabled="disabled" @click="editCustomer" size="small">{{  form.id ? "确认修改" : "确认新增"          }}        </el-button>      </div>    </div>    <div class="customer-main">      <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">        <containerTitle title="基础资料"></containerTitle>        <basic-container>          <el-row>            <el-col v-for="(item, index) in basicData.column" :key="index" :span="item.span ? item.span : 8">              <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">                <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple style="width: 100%;" size="small"                  :props="{ label: 'title' }" v-model="form[item.prop]" placeholder=" " type="tree" :dic="dic">                </avue-input-tree>                <el-cascader v-else-if="item.prop === 'belongtoarea'" v-model="form[item.prop]" collapse-tags                  :options="dicArea" :props="props" size="small" style="width: 100%;" :show-all-levels="false"                  @change="addressChange"></el-cascader>                <!--                <avue-input-tree-->                <!--                  v-else-if="item.prop === 'belongtoarea'"-->                <!--                  leaf-only-->                <!--                  multiple-->                <!--                  tags-->                <!--                  style="width: 100%;"-->                <!--                  size="small"-->                <!--                  :props="{ label: 'name', value: 'name' }"-->                <!--                  v-model="form[item.prop]"-->                <!--                  placeholder=" "-->                <!--                  type="tree"-->                <!--                  :dic="dicArea"-->                <!--                ></avue-input-tree>-->                <el-select v-else-if="item.prop === 'adminProfiles'" size="small" style="width: 100%;"                  v-model="form[item.prop]" multiple placeholder="">                  <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id">                  </el-option>                </el-select>                <el-select v-else-if="item.prop === 'creditRating'" size="small" style="width: 100%;"                  v-model="form[item.prop]" placeholder="">                  <el-option v-for="item in creditRatingList" :key="item.id" :label="item.dictValue"                    :value="item.dictValue">                  </el-option>                </el-select>                <el-select v-else-if="item.prop === 'line'" size="small" style="width: 100%;"                  v-model="form[item.prop]" clearable placeholder="请选择" multiple collapse-tags>                  <el-option v-for="item in lineList" :key="item.id" :label="item.dictValue" :value="item.dictKey">                  </el-option>                </el-select>                <crop-select v-else-if="item.prop === 'belongtocompany'" v-model="form[item.prop]"                  @getCorpData="getCorpName" corpType="GS"></crop-select>                <el-input type="text" v-else-if="item.prop === 'initials'" v-model="form[item.prop]" size="small"                  autocomplete="off" :disabled="item.disabled" show-word-limit maxlength="1"></el-input>                <el-input type="textarea" v-else-if="item.prop === 'remarks'" :rows="1" placeholder="请输入内容"                  v-model="form[item.prop]">                </el-input>                <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"                  :disabled="item.disabled"></el-input>              </el-form-item>            </el-col>          </el-row>        </basic-container>        <containerTitle title="联系方式"></containerTitle>        <basic-container>          <el-row>            <el-col v-for="(item, index) in contactInformation.column" :key="index" :span="item.span ? item.span : 8">              <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">                <el-input type="textarea" v-if="item.prop === 'addr'" :rows="2" placeholder="请输入内容"                  v-model="form[item.prop]">                </el-input>                <el-input type="textarea" v-else-if="item.prop === 'storageAddr'" :rows="2" placeholder="请输入内容"                  v-model="form[item.prop]">                </el-input>                <el-input type="textarea" v-else-if="item.prop === 'subStorageAddr'" :rows="2" placeholder="请输入内容"                  v-model="form[item.prop]">                </el-input>                <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off"></el-input>              </el-form-item>            </el-col>          </el-row>        </basic-container>        <containerTitle title="财务资料"></containerTitle>        <basic-container>          <el-row>            <el-col v-for="(item, index) in financialInformation.column" :key="index" :span="item.span ? item.span : 8">              <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules" v-if="!item.hide">                <el-switch v-if="item.prop === 'creditstatus'" v-model="form[item.prop]" active-value="0"                  inactive-value="1" active-text="开启" inactive-text="关闭">                </el-switch>                <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" clearable filterable                  size="small" style="width: 100%;">                  <el-option v-for="(item, index) in paymentOption" :key="index" :label="item.dictValue"                    :value="item.dictValue"></el-option>                </el-select>                <el-select v-else-if="item.prop === 'packageRemarks'" v-model="form[item.prop]" clearable filterable                  size="small" style="width: 100%;">                  <el-option v-for="(item, index) in packageOptions" :key="index" :label="item.dictValue"                    :value="item.dictValue"></el-option>                </el-select>                <el-select v-else-if="item.prop === 'a'" v-model="form[item.prop]" clearable filterable size="small"                  style="width: 100%;" @change="aChange">                  <el-option v-for="(item, index) in settingOption" :key="index" :label="item.dictValue"                    :value="item.dictValue"></el-option>                </el-select>                <el-select v-else-if="item.prop === 'c'" v-model="form[item.prop]" clearable filterable size="small"                  style="width: 100%;" @change="cChange">                  <el-option v-for="(item, index) in monthOption" :key="index" :label="item.dictValue"                    :value="item.dictKey"></el-option>                </el-select>                <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off"></el-input>              </el-form-item>            </el-col>          </el-row>        </basic-container>        <containerTitle title="客户联系人"></containerTitle>        <basic-container>          <avue-crud ref="crud" :option="customerContact" v-model="contactsForm" :data="contactsData"            @saveColumn="saveColumn" @resetColumn="resetColumn" @row-save="rowSave" @row-update="rowUpdate"            @row-del="rowDel">            <template slot-scope="{ type, size, row }" slot="menu">              <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>            </template>          </avue-crud>        </basic-container>        <!-- <containerTitle title="客户优势项目"></containerTitle>        <basic-container style="margin-bottom: 10px">          <avue-crud            :option="advantageProject"            v-model="advantageProjectForm"            :data="advantageProjectData"            @row-save="rowSaveProject"            @row-update="rowUpdateProject"            @row-del="rowDelProject"          ></avue-crud>        </basic-container> -->        <containerTitle title="客户开户行"></containerTitle>        <basic-container>          <avue-crud ref="crud2" :option="bankOfDeposit" v-model="bankOfDepositForm" :data="bankOfDepositData"            @saveColumn="saveColumn2" @resetColumn="resetColumn2" @row-save="rowSaveBankOfDeposit"            @row-update="rowUpdateBankOfDeposit" @row-del="rowDelBankOfDeposit"></avue-crud>        </basic-container>        <containerTitle title="收发货地址"></containerTitle>        <basic-container>          <avue-crud ref="crud3" :option="addressOption" v-model="addressForm" :data="addressData"            @saveColumn="saveColumn3" @resetColumn="resetColumn3" @row-save="rowSaveAddress"            @row-update="rowUpdateAddress" @row-del="rowDelAddress"></avue-crud>        </basic-container>      </el-form>    </div>    <flow-dialog :switchDialog="switchDialog" @onClose="onClose()">      <template slot="content"> </template>    </flow-dialog>    <el-dialog title="同 步" :visible.sync="dialogVisible" append-to-body width="60%">      <avue-form ref="formData" v-model="formData" :option="option">      </avue-form>      <span slot="footer" class="dialog-footer">        <el-button @click="dialogVisible = false">取 消</el-button>        <el-button type="primary" @click="confirmSynchronization">确 定</el-button>      </span>    </el-dialog>    <el-dialog title="创建用户" :visible.sync="dialogVisibleBt" append-to-body width="60%">      <avue-form ref="formDataTwo" v-model="formDataTwo" :option="optionData">      </avue-form>      <span slot="footer" class="dialog-footer">        <el-button @click="dialogVisibleBt = false">取 消</el-button>        <el-button type="primary" @click="confirmSynchronizationTwo">确 定</el-button>      </span>    </el-dialog>  </div></template><script>import {  customerList,  typeSave,  detail,  deleteDetails,  corpstypeTree,  corpsattn,  corpsbank,  corpsfiles,  corpsitem,  areaTypeTree,  corpsAddrDelete,  synchronizationCopy,  creatingUsers} from "@/api/basicData/customerInformation";import customerContact from "./configuration/customerContact.json";import advantageProject from "./configuration/advantageProject.json";import bankOfDeposit from "./configuration/bankOfDeposit.json";import flowDialog from "@/components/flow-dialog/main";import { customerParameter } from "@/enums/management-type";import { gainUser } from "@/api/basicData/customerInquiry";import addressOption from "./configuration/addressOption.json";import website from "@/config/website";import { getRoleTree } from "@/api/system/role";import { getDeptTree } from "@/api/system/dept";import { getPostList } from "@/api/system/post";import { contrastObj, contrastList } from "@/util/contrastData";export default {  name: "detailsPage",  data() {    return {      userList: [],      formData: {},      formDataTwo: {},      creditRatingList: [],      lineList: [],      optionData: {        span: 8,        menuBtn: false,        column: [          {            label: "所属角色",            prop: "roleId",            multiple: true,            type: "tree",            dicData: [],            props: {              label: "title"            },            checkStrictly: true,            slot: true,            rules: [              {                required: true,                message: "请选择所属角色",                trigger: "click"              }            ]          },          {            label: "所属部门",            prop: "deptId",            type: "tree",            multiple: true,            dicData: [],            props: {              label: "title"            },            checkStrictly: true,            slot: true,            rules: [              {                required: true,                message: "请选择所属部门",                trigger: "click"              }            ]          },          {            label: "所属岗位",            prop: "postId",            type: "tree",            multiple: true,            dicData: [],            props: {              label: "postName",              value: "id"            },            rules: [              {                required: true,                message: "请选择所属岗位",                trigger: "click"              }            ]          }        ]      },      dialogVisibleBt: false,      dialogVisible: false,      option: {        span: 12,        menuBtn: false,        column: [          {            label: "客户类型",            prop: "corpType",            type: "select",            cascader: ["corpsTypeId"],            dicUrl: "/api/blade-system/dict-biz/dictionary?code=corp_type",            props: {              label: "dictValue",              value: "dictKey"            },            rules: [              {                required: true,                message: "请选择客户类型",                trigger: "blur"              }            ]          },          {            label: "类别",            prop: "corpsTypeId",            type: "tree",            dicUrl: "/api/blade-client/corpstype/tree?&corpType={{key}}",            props: {              label: "title",              value: "value"            },            rules: [              {                required: true,                message: "请选择类型",                trigger: "blur"              }            ]          }        ]      },      switchDialog: false,      form: {},      disabled: false,      contactsForm: {},      advantageProjectForm: {},      bankOfDepositForm: {},      contactsData: [],      advantageProjectData: [],      bankOfDepositData: [],      dic: [],      dicArea: [],      customerContact: {},      advantageProject: advantageProject,      bankOfDeposit: {},      contactInformation: {        column: [          {            label: "联系人",            prop: "attn",            rules: [              {                required: false,                message: "请输入联系人",                trigger: "blur"              }            ]          },          {            label: "联系电话",            prop: "tel",            rules: [              {                required: false,                message: "请输入联系电话",                trigger: "blur"              }            ]          },          {            label: "职位",            prop: "position",            rules: [              {                required: false,                message: "请输入联系电话",                trigger: "blur"              }            ]          },          {            label: "单位地址",            prop: "addr",            rules: [              {                required: false,                message: "请输入单位地址",                trigger: "blur"              }            ]          },          {            label: "仓库地址",            prop: "storageAddr",            rules: [              {                required: false,                message: "请输入仓库地址",                trigger: "blur"              }            ]          },          {            label: "分仓地址",            prop: "subStorageAddr",            rules: [              {                required: false,                message: "请输入分仓地址",                trigger: "blur"              }            ]          }        ]      },      financialInformation: {        column: [          {            label: "账户名称",            prop: "accountName",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "开户银行",            prop: "accountBank",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "银行帐号",            prop: "accountNo",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "CNAPS",            prop: "cnaps",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "银行地址",            prop: "localBankAddress",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "外币账户名称",            prop: "accountNameFcy",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "外币开户银行",            prop: "accountBankFcy",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "外币银行账号",            prop: "accountNoFcy",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "Swift Code",            prop: "swiftCode",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "外币银行地址",            prop: "foreignBankAddress",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "授信状态",            prop: "creditstatus",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "授信等级",            prop: "creditLevel",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "授信额度",            prop: "creditGrant",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "授信天数",            prop: "creditDay",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "授信利率",            prop: "creditRate",            span: 8,            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "FOB系数",            span: 8,            prop: "coefficient"          },          {            label: "付款方式",            span: 8,            prop: "paymentType"          },          {            label: "包装要求",            span: 8,            prop: "packageRemarks"          },          {            label: "账期设置",            span: 8,            prop: "a"          },          {            label: "天数",            span: 8,            hide: true,            prop: "b"          },          {            label: "结清月份",            span: 8,            hide: true,            prop: "c"          },          {            label: "结清天数",            span: 8,            hide: true,            prop: "j"          },          {            label: "日利息万分",            span: 8,            prop: "d"          },          {            label: "最大欠款额",            span: 8,            prop: "e"          },          {            label: "协议号",            span: 8,            prop: "f"          },          {            label: "账期日期",            span: 8,            prop: "g"          },          {            label: "账期备注",            span: 24,            prop: "h"          }        ]      },      basicData: {        column: [          {            label: "编码",            prop: "code",            rules: [              {                required: true,                message: " ",                trigger: "blur"              }            ]          },          {            label: "名称",            prop: "cname",            rules: [              {                required: true,                message: " ",                trigger: "blur"              }            ]          },          {            label: "简称",            prop: "shortName"          },          {            label: "类别",            prop: "corpsTypeId",            rules: [              {                required: true,                message: " ",                trigger: "blur"              }            ]          },          {            label: "企业类型",            prop: "companytype",            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "代理品牌",            prop: "goodtypes",            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "所属公司",            prop: "belongtocompany",            rules: [              {                required: false,                message: " ",                trigger: "blur"              }            ]          },          {            label: "分管员",            prop: "adminProfiles",            span: 8          },          {            label: "区域",            prop: "belongtoarea",            span: 8,            mock: {              type: "county"            }          },          {            label: "信用等级",            prop: "creditRating",            span: 8          },          {            label: "代理商编码",            prop: "agentCode",            span: 8          }, {            label: "首字母",            prop: "initials",            span: 8          },{            label: "优势航线",            prop: "line",            span: 8          },          // {          //   label: "总返利",          //   prop: "profitReturn",          //   disabled: true,          //   span: 8          // },          // {          //   label: "已用返利",          //   prop: "usedProfit",          //   disabled: true,          //   span: 8          // },          // {          //   label: "可用返利",          //   prop: "surplusProfit",          //   disabled: false,          //   span: 8          // },          // {          //   label: "可用返利",          //   prop: "monthProfit",          //   disabled: true,          //   span: 8          // },          {            label: "备注",            prop: "remarks",            span: 16,            mock: {              type: "county"            }          }        ]      },      paymentOption: [],      settingOption: [],      monthOption: [],      addressOption: {},      addressForm: {},      addressData: [],      formRow: {},      // 包装要求      packageOptions: [],      props: {        value: "name",        label: "name",        multiple: true      },      addressLatLng: [],      oldform: {        creditstatus:'1'      },      oldcontactsData: [],      oldbankOfDepositData: [],      oldadvantageProjectData: [],      oldaddressLatLng: [],      oldaddressData: [],    };  },  props: {    detailData: {      type: Object    }  },  components: {    flowDialog  },  async created() {    this.customerContact = await this.getColumnData(      this.getColumnName(143),      customerContact    );    this.bankOfDeposit = await this.getColumnData(      this.getColumnName(144),      bankOfDeposit    );    this.addressOption = await this.getColumnData(      this.getColumnName(145),      addressOption    );    if (!website.tenantMode) {      this.initData(website.tenantId);    } else {      this.initData();    }    if (this.$store.getters.userInfo.tenant_id === "096359") {      let list = ["profitReturn", "usedProfit", "surplusProfit", "monthProfit"];      for (let item in list) {        for (let i in this.basicData.column) {          if (list[item] == this.basicData.column[i].prop) {            this.basicData.column.splice(i, 1);          }        }      }    }    corpstypeTree({ corpType: customerParameter.code }).then(res => {      this.dic = res.data.data;    });    areaTypeTree().then(res => {      this.dicArea = res.data.data;    });    this.getWorkDicts("packageRemarks").then(res => {      this.packageOptions = res.data.data;    });    this.getWorkDicts("payment_term").then(res => {      this.paymentOption = res.data.data;    });    this.getWorkDicts("account_period").then(res => {      this.settingOption = res.data.data;    });    this.getWorkDicts("month").then(res => {      this.monthOption = res.data.data;    });    this.getWorkDicts("credit_rating").then(res => {      this.creditRatingList = res.data.data;    });    this.getWorkDicts("dominant_route").then(res => {      this.lineList = res.data.data;    });    if (this.$route.query.customerName) {      this.returnButton = true    } else {      this.returnButton = true    }    if (this.detailData.id) {      detail(this.detailData.id).then(res => {        if (res.data.data.adminProfiles) {          res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");        }        if (res.data.data.line){          res.data.data.line = res.data.data.line.split(",")        }        this.form = res.data.data;        this.contactsData = this.form.corpsAttnList;        this.bankOfDepositData = this.form.corpsBankList;        this.advantageProjectData = this.form.corpsItems;        this.addressLatLng = JSON.parse(this.form.addressLatLng);        this.addressData = this.form.corpsAddrList;        this.oldform = this.deepClone(res.data.data);        this.oldcontactsData = this.deepClone(this.form.corpsAttnList);        this.oldbankOfDepositData = this.deepClone(this.form.corpsBankList);        this.oldadvantageProjectData = this.deepClone(this.form.corpsItems);        this.oldaddressLatLng = this.deepClone(JSON.parse(this.form.addressLatLng));        this.oldaddressData = this.deepClone(this.form.corpsAddrList);        if (this.form.belongtoarea) {          this.form.belongtoarea = this.form.belongtoarea            .split(",")            .map(item => item.split("/"));        }        delete this.form.corpsAttnList;        delete this.form.corpsBankList;        delete this.form.corpsItems;        delete this.form.corpsAddrList;      });    } else if (this.detailData.treeDeptId) {      this.$set(this.form, "corpsTypeId", this.detailData.treeDeptId);      if (this.$route.query.customerName) {        this.$set(this.form, "cname", this.$route.query.customerName);        this.$router.$avueRouter.closeTag(window.location.hash.slice(1))      } else if (this.$route.query) {        this.$set(this.form, "cname", this.$route.query.corpName);      }    } else {      if (this.$route.query.customerName) {        this.$set(this.form, "cname", this.$route.query.customerName);        this.$router.$avueRouter.closeTag(window.location.hash.slice(1))      } else if (this.$route.query) {        this.$set(this.form, "cname", this.$route.query.corpName);      }    }    gainUser().then(res => {      this.userList = res.data.data;    });    this.getWorkDicts("currency").then(res => {      this.findObject(this.bankOfDeposit.column, "fcyno").dicData =        res.data.data;    });  },  methods: {    initData(tenantId) {      getRoleTree(tenantId).then(res => {        const column = this.findObject(this.optionData.column, "roleId");        column.dicData = res.data.data;      });      getDeptTree(tenantId).then(res => {        const column = this.findObject(this.optionData.column, "deptId");        column.dicData = res.data.data;      });      getPostList(tenantId).then(res => {        const column = this.findObject(this.optionData.column, "postId");        column.dicData = res.data.data;      });    },    addressChange() {      this.addressLatLng = [];      this.form.belongtoarea.forEach(e => {        if (e.length == 1) {          this.dicArea.forEach(item1 => {            if (item1.provinceName == e[0]) {              this.addressLatLng.push({                name: item1.provinceName,                value: this.addressLatLng.length + 1,                lng: item1.lng,                lat: item1.lat,                zoom: 1              });            }          });        } else if (e.length == 3) {          this.dicArea.forEach(item1 => {            if (item1.provinceName == e[0]) {              if (item1.children.length > 0) {                item1.children.forEach(item2 => {                  if (item2.cityName == e[1]) {                    if (e[0] == e[1]) {                      if (item2.children.length > 0) {                        item2.children.forEach(item3 => {                          if (item3.districtName == e[2]) {                            this.addressLatLng.push({                              name: item3.districtName,                              value: this.addressLatLng.length + 1,                              lng: item3.lng,                              lat: item3.lat,                              zoom: 1                            });                          }                        });                      }                    } else if (e[0] != e[1]) {                      this.addressLatLng.push({                        name: item2.cityName,                        value: this.addressLatLng.length + 1,                        lng: item2.lng,                        lat: item2.lat,                        zoom: 1                      });                    }                  }                });              }            }          });        }      });      this.addressLatLng = this.addressLatLng.filter(        (currentValue, currentIndex, selfArr) => {          return (            selfArr.findIndex(x => x.name === currentValue.name) ===            currentIndex          );        }      );    },    //确认创建用户    confirmSynchronizationTwo() {      this.$refs["formDataTwo"].validate((valid, done) => {        done();        if (valid) {          let data = JSON.parse(JSON.stringify(this.formDataTwo));          data.deptId = data.deptId.join(",");          data.roleId = data.roleId.join(",");          data.postId = data.postId.join(",");          creatingUsers({            ...data,            id: this.formRow.id          }).then(res => {            this.dialogVisibleBt = false;            this.$message.success(              "创建用户成功,默认帐号:手机号。默认密码:123456"            );          });        } else {          return false;        }      });    },    aChange(row) {      console.log(row)      if (row == '月结') {        this.financialInformation.column.forEach(e => {          if (e.prop == 'b') {            e.hide = true          }          if (e.prop == 'c') {            e.hide = false          }          if (e.prop == 'j') {            e.hide = false          }        })      } else if (row == '业务后') {        this.financialInformation.column.forEach(e => {          if (e.prop == 'b') {            e.hide = false          }          if (e.prop == 'c') {            e.hide = true          }          if (e.prop == 'j') {            e.hide = true          }        })      } else {        this.financialInformation.column.forEach(e => {          if (e.prop == 'b') {            e.hide = true          }          if (e.prop == 'c') {            e.hide = true          }          if (e.prop == 'j') {            e.hide = true          }        })      }    },    creatingUsers(row) {      if (row.id) {        if (row.tel) {          this.dialogVisibleBt = true;          this.formDataTwo = {};          this.formRow = row;        } else {          this.$message.error("请输入手机号");        }      } else {        this.$message.error("请保存数据后再点击");      }    },    //新增客户联系人保存触发    rowSave(row, done, loading) {      console.log(row, done, loading);      this.contactsData.push(row);      done();    },    //修改客户联系人触发    rowUpdate(row, index, done, loading) {      done(row);    },    //删除客户联系人触发    rowDel(row, index, donerowDel) {      this.$confirm("确定将选择数据删除?", {        confirmButtonText: "确定",        cancelButtonText: "取消",        type: "warning"      }).then(() => {        // 数据回调进行刷新        if (row.id) {          corpsattn(row.id).then(res => {            this.$message({              type: "success",              message: "操作成功!"            });            this.contactsData.splice(index, 1);          });        } else {          this.$message({            type: "success",            message: "操作成功!"          });          this.contactsData.splice(index, 1);        }      });    },    //新增客户优势项目保存触发    rowSaveProject(row, done, loading) {      console.log(row, done, loading);      this.advantageProjectData.push(row);      done();    },    //修改客户优势项目触发    rowUpdateProject(row, index, done, loading) {      done(row);    },    //删除客户优势项目触发    rowDelProject(row, index, donerowDel) {      this.$confirm("确定将选择数据删除?", {        confirmButtonText: "确定",        cancelButtonText: "取消",        type: "warning"      }).then(() => {        if (row.id) {          corpsitem(row.id).then(res => {            this.$message({              type: "success",              message: "操作成功!"            });            this.advantageProjectData.splice(index, 1);          });        } else {          this.$message({            type: "success",            message: "操作成功!"          });          this.advantageProjectData.splice(index, 1);        }      });    },    //新增客户优势项目保存触发    rowSaveBankOfDeposit(row, done, loading) {      console.log(row, done, loading);      this.bankOfDepositData.push(row);      done();    },    //修改客户优势项目触发    rowUpdateBankOfDeposit(row, index, done, loading) {      done(row);    },    //删除客户优势项目触发    rowDelBankOfDeposit(row, index, donerowDel) {      this.$confirm("确定将选择数据删除?", {        confirmButtonText: "确定",        cancelButtonText: "取消",        type: "warning"      }).then(() => {        if (row.id) {          corpsbank(row.id).then(res => {            this.$message({              type: "success",              message: "操作成功!"            });            this.bankOfDepositData.splice(index, 1);          });        } else {          this.$message({            type: "success",            message: "操作成功!"          });          this.bankOfDepositData.splice(index, 1);        }      });    },    //新增收发货地址保存触发    rowSaveAddress(row, done, loading) {      this.addressData.push(row);      done();    },    //修改收发货地址优势项目触发    rowUpdateAddress(row, index, done, loading) {      done(row);    },    //删除收发货地址优势项目触发    rowDelAddress(row, index, donerowDel) {      this.$confirm("确定将选择数据删除?", {        confirmButtonText: "确定",        cancelButtonText: "取消",        type: "warning"      }).then(() => {        if (row.id) {          corpsAddrDelete(row.id).then(res => {            this.$message({              type: "success",              message: "操作成功!"            });            this.addressData.splice(index, 1);          });        } else {          this.$message({            type: "success",            message: "操作成功!"          });          this.addressData.splice(index, 1);        }      });    },    //修改提交触发    editCustomer(status) {      this.$refs["form"].validate(valid => {        if (valid) {          this.form.corpsAttnList = this.contactsData;          this.form.corpsBankList = this.bankOfDepositData;          this.form.corpsItems = this.advantageProjectData;          this.form.corpsAddrList = this.addressData;          this.form.addressLatLng = JSON.stringify(this.addressLatLng);          if (typeof this.form.corpsTypeId == "object") {            this.form.corpsTypeId = this.form.corpsTypeId.join(",");          }          if (typeof this.form.corpsTypeId == "object"){            this.form.line = this.form.line.join(",")          }          this.disabled = true;          if (this.form.belongtoarea) {            // this.form.belongtoarea = this.form.belongtoarea.toString();            this.form.belongtoarea = this.form.belongtoarea              .map(e => e.join("/"))              .join(",");          }          if (this.form.adminProfiles) {            this.form.adminProfiles = this.form.adminProfiles.join(",");          }          this.form.corpType = customerParameter.code;          typeSave(this.form).then(res => {            if (res.data.data === "error") {              this.disabled = false;              this.$message({                showClose: true,                message: res.data.msg,                type: "error"              });            } else {              this.$message({                type: "success",                message: this.form.id ? "修改成功!" : "新增成功!"              });              if (res.data.data.adminProfiles) {                res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");              }              if (res.data.data.line){                res.data.data.line = res.data.data.line.split(",")              }              this.form = res.data.data;              this.contactsData = res.data.data.corpsAttnList;              if (this.form.belongtoarea) {                this.form.belongtoarea = this.form.belongtoarea                  .split(",")                  .map(item => item.split("/"));              }              this.disabled = false;              if (status) {                this.$emit("goBack", true);              }            }          });        } else {          return false;        }      });    },    synchronization() {      this.dialogVisible = true;    },    async saveColumn() {      const inSave = await this.saveColumnData(        this.getColumnName(143),        this.customerContact      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud.doLayout();        });        this.$message.success("保存成功");        //关闭窗口        this.$refs.crud.$refs.dialogColumn.columnBox = false;      }    },    async resetColumn() {      this.customerContact = customerContact;      const inSave = await this.delColumnData(        this.getColumnName(143),        customerContact      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud.doLayout();        });        this.$message.success("重置成功");        this.$refs.crud.$refs.dialogColumn.columnBox = false;      }    },    async saveColumn2() {      const inSave = await this.saveColumnData(        this.getColumnName(144),        this.bankOfDeposit      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud2.doLayout();        });        this.$message.success("保存成功");        //关闭窗口        this.$refs.crud2.$refs.dialogColumn.columnBox = false;      }    },    async resetColumn2() {      this.bankOfDeposit = bankOfDeposit;      const inSave = await this.delColumnData(        this.getColumnName(144),        bankOfDeposit      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud2.doLayout();        });        this.$message.success("重置成功");        this.$refs.crud2.$refs.dialogColumn.columnBox = false;      }    },    async saveColumn3() {      const inSave = await this.saveColumnData(        this.getColumnName(145),        this.addressOption      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud3.doLayout();        });        this.$message.success("保存成功");        //关闭窗口        this.$refs.crud3.$refs.dialogColumn.columnBox = false;      }    },    async resetColumn3() {      this.addressOption = addressOption;      const inSave = await this.delColumnData(        this.getColumnName(145),        addressOption      );      if (inSave) {        this.$nextTick(() => {          this.$refs.crud3.doLayout();        });        this.$message.success("重置成功");        this.$refs.crud3.$refs.dialogColumn.columnBox = false;      }    },    //确认同步    confirmSynchronization() {      this.$refs["formData"].validate((valid, done) => {        if (valid) {          synchronizationCopy({            ...this.formData,            id: this.form.id          }).then(res => {            done();            this.$message.success("同步成功");            this.dialogVisible = false;          });        } else {          return done();        }      });    },    backToList(value) {      console.log(value)      if (value == '0') {        this.$emit("goBack");      } else {        console.log(this.form, this.oldform)        if (          contrastObj(this.form, this.oldform) ||          contrastList(this.contactsData, this.oldcontactsData) ||          contrastList(this.bankOfDepositData, this.oldbankOfDepositData) ||          contrastList(this.advantageProjectData, this.oldadvantageProjectData) ||          contrastList(this.addressLatLng, this.oldaddressLatLng) ||          contrastList(this.addressData, this.oldaddressData)        ) {          this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {            confirmButtonText: "确定",            cancelButtonText: "取消",            type: "warning"          })            .then(() => {              this.editCustomer("goBack");            })            .catch(() => {              this.$emit("goBack", true);            });        }else{          this.$emit("goBack", true);        }      }    },    openFlow() {      this.switchDialog = !this.switchDialog;    },    onClose(val) {      this.switchDialog = val;    },    getCorpName(row) { }  }};</script><style lang="scss" scoped>::v-deep .el-form-item {  margin-bottom: 0;}::v-deep .el-form-item__content {  line-height: 32px;}</style>
 |