123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440 |
- <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(null)" 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 v-if="dialogVisibleBt" 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: "纳税人识别号",
- prop: "taxpayerDifferenceCode"
- },
- {
- label: "包装要求",
- span: 8,
- prop: "packageRemarks"
- },
- {
- label: "账期设置",
- span: 8,
- prop: "a"
- },
- {
- label: "天数",
- span: 8,
- prop: "b"
- },
- {
- label: "结清月份",
- span: 8,
- prop: "c"
- },
- {
- label: "结清天数",
- span: 8,
- 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.formDataTwo = {}
- 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 (this.form.line&&typeof this.form.line == "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) {
- 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>
|