| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935 |
- <template>
- <ele-modal
- custom-class="ele-dialog-form long-dialog-form"
- :centered="true"
- v-if="visible"
- :visible.sync="visible"
- :title="title"
- :close-on-click-modal="false"
- :append-to-body="true"
- width="70%"
- :maxable="true"
- :resizable="true"
- @close="cancel"
- >
- <el-tabs v-model="activeName" type="card" @tab-click="handleActive">
- <el-tab-pane label="基本信息" name="1">
- <headerTitle title="基本信息" style="margin-top: 30px"></headerTitle>
- <el-form
- label-width="120px"
- ref="form"
- class="el-form-box"
- :model="form"
- :rules="rules"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="分类" prop="categoryId">
- <ele-tree-select
- :data="categoryTreeList"
- v-model="categoryIdList"
- multiple
- filterable
- :checkStrictly="true"
- valueKey="id"
- labelKey="name"
- placeholder="请选择"
- default-expand-all
- ref="treeSelect"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="对像类型 "
- prop="objectType"
- >
- <el-select
- v-model="form.objectType"
- clearable
- style="width: 100%"
- >
- <el-option
- :key="1"
- label="企业"
- :value="1"
- >
- </el-option>
- <el-option
- :key="2"
- label="个人"
- :value="2"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="名称" prop="name">
- <el-input
- placeholder="请输入"
- v-model="form.name"
- maxlength="50"
- @change="nameChange"
- ></el-input>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item
- :label="form.objectType == 1 ? '统一信用代码' : '身份证号'"
- prop="unifiedSocialCreditCode"
- >
- <el-input
- placeholder="请输入"
- v-model="form.unifiedSocialCreditCode"
- maxlength="18"
- @change="unifiedSocialCreditCodeChange"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="简称">
- <el-input
- placeholder="请输入"
- v-model="form.simpleName"
- maxlength="50"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="代号"
- prop="serialNo"
- :rules="{
- required: false,
- message: '请输入',
- trigger: 'change'
- }"
- >
- <el-input
- placeholder="请输入"
- v-model="form.serialNo"
- maxlength="50"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="法定代表人" prop="legalPerson">
- <el-input
- placeholder="请输入"
- v-model="form.legalPerson"
- maxlength="50"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="所属行业" prop="industry">
- <DictSelection
- dictName="所属行业"
- clearable
- v-model="form.industryCode"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="企业类型" prop="companyCategoryId">
- <DictSelection
- dictName="营业类型"
- clearable
- v-model="form.companyCategoryId"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8" style="height: 40px;">
- <el-form-item label="企业性质" prop="enterpriseTypeId">
- <DictSelection
- dictName="企业类型"
- clearable
- v-model="form.enterpriseTypeId"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="上级单位" prop="parentId">
- <el-input
- placeholder="请选择上级单位"
- v-model="form.parentName"
- readonly
- @click.native="handParent"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="注册资本" prop="registeredCapital">
- <el-input
- placeholder="请输入"
- v-model="form.registeredCapital"
- maxlength="50"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="授信额度" prop="authorizationLimit">
- <el-input
- placeholder="请输入"
- v-model="form.authorizationLimit"
- maxlength="17"
- oninput="value=value.replace(/[^0-9.]/g,'')"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="单位电话" prop="phone">
- <el-input
- placeholder="请输入"
- v-model="form.phone"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="成立日期" prop="registerDate">
- <el-date-picker
- style="width: 100%"
- clearable
- v-model="form.registerDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请选择日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8" style="height: 40px;">
- <el-form-item label="级别:">
- <DictSelection
- dictName="供应商级别"
- clearable
- v-model="form.level"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="企业规模"
- prop="enterpriseScale"
- style="height: 36px"
- >
- <DictSelection
- dictName="企业规模"
- clearable
- v-model="form.enterpriseScale"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="员工人数" prop="staffCount">
- <el-input
- placeholder="请输入"
- v-model="form.staffCount"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="英文名称" prop="englishName">
- <el-input
- placeholder="请输入"
- v-model="form.englishName"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="纳税人资质" prop="taxpayerQualification">
- <DictSelection
- dictName="纳税人资质"
- clearable
- v-model="form.taxpayerQualification"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="企业荣誉" prop="enterpriseHonor">
- <DictSelection
- dictName="企业荣誉"
- clearable
- v-model="form.enterpriseHonor"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="8" v-if="form.type != 2">
- <el-form-item label="客户审查" prop="qualificationCensorship">
- <el-radio v-model="form.qualificationCensorship" label="1"
- >启用</el-radio
- >
- <el-radio v-model="form.qualificationCensorship" label="2"
- >不启用</el-radio
- >
- </el-form-item>
- </el-col> -->
- <el-col :span="24">
- <el-form-item label="注册地址" prop="addressId">
- <el-cascader
- filterable
- clearable
- v-model="form.addressId"
- :options="options.cityData"
- ref="address"
- style="width: 35%"
- placeholder="请选择省市区/县"
- @change="changeAddress1"
- ></el-cascader>
- <el-input
- placeholder="请输入详细地址"
- v-model="form.address"
- style="width: 65%"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-form
- label-width="120px"
- ref="otherForm"
- class="el-form-box"
- :model="otherForm"
- :rules="otherRules"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="联系地址" prop="address">
- <el-cascader
- @change="changeAddress2"
- clearable
- v-model="otherForm.addressId"
- :options="options.cityData"
- ref="sendAddress"
- style="width: 35%"
- placeholder="请选择省市区/县"
- ></el-cascader>
- <el-input
- placeholder="请输入详细地址"
- v-model="otherForm.address"
- maxlength="50"
- style="width: 65%"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="主营产品" prop="mainProduct">
- <el-input
- placeholder="请输入"
- v-model="form.mainProduct"
- type="textarea"
- maxlength="500"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="经营范围" prop="businessScope">
- <el-input
- type="textarea"
- maxlength="500"
- placeholder="请输入"
- v-model="form.businessScope"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="企业简介" prop="enterpriseProfile">
- <el-input
- placeholder="请输入"
- v-model="form.enterpriseProfile"
- type="textarea"
- maxlength="500"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="备注" prop="remark">
- <el-input
- type="textarea"
- resize="none"
- v-model="form.remark"
- :rows="2"
- placeholder="请输入"
- size="small"
- maxlength="200"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-tab-pane>
- <el-tab-pane label="银行信息" name="2">
- <headerTitle title="银行信息" style="margin-top: 30px"></headerTitle>
- <ele-pro-table
- ref="table"
- :columns="bankColumns"
- :datasource="tableBankData"
- height="350px"
- :toolkit="[]"
- class="el-form-box"
- :need-page="false"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button type="primary" @click="addBank">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- @click="handleBankDel(row, $index)"
- >删除
- </el-link>
- </template>
- <template v-slot:accountNameHeader="{ column }">
- <span>{{ column.label }}</span
- ><span style="color: red">*</span>
- </template>
- <template v-slot:accountName="{ row }">
- <el-input
- v-model="row.accountName"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:accountNo="{ row }">
- <el-input
- v-model="row.accountNo"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:bankName="{ row }">
- <el-input
- v-model="row.bankName"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:interbankNo="{ row }">
- <el-input
- v-model="row.interbankNo"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="联系人信息" name="3">
- <headerTitle title="联系人信息" style="margin-top: 30px"></headerTitle>
- <ele-pro-table
- ref="linkTable"
- :columns="linkColumns"
- :datasource="tableLinkData"
- :toolkit="[]"
- height="350px"
- class="el-form-box"
- :need-page="false"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button type="primary" @click="addLink">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- @click="handleLinkDel(row, $index)"
- >删除
- </el-link>
- </template>
- <template v-slot:linkNameHeader="{ column }">
- <span>{{ column.label }}</span
- ><span style="color: red">*</span>
- </template>
- <template v-slot:mobilePhoneHeader="{ column }">
- <span>{{ column.label }}</span
- ><span style="color: red">*</span>
- </template>
- <template v-slot:statusHeader="{ column }">
- <span>{{ column.label }}</span
- ><span style="color: red">*</span>
- </template>
- <template v-slot:linkName="{ row }">
- <el-input
- v-model="row.linkName"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:mobilePhone="{ row }">
- <el-input
- v-model="row.mobilePhone"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </template>
- <template v-slot:phone="{ row }">
- <el-input
- v-model="row.phone"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </template>
- <template v-slot:wechat="{ row }">
- <el-input
- v-model="row.wechat"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:email="{ row }">
- <el-input
- v-model="row.email"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:deptName="{ row }">
- <el-input
- v-model="row.deptName"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- <template v-slot:post="{ row }">
- <el-input
- v-model="row.post"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </template>
- <template v-slot:ifChief="{ row, $index }">
- <el-select
- v-model="row.ifChief"
- placeholder="请选择"
- class="w100"
- @change="
- (value) => {
- ifChiefChange(value, $index);
- }
- "
- >
- <el-option
- v-for="item in ifChiefList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </template>
- <template v-slot:isDefault="{ row, $index }">
- <el-select
- v-model="row.isDefault"
- placeholder="请选择"
- class="w100"
- >
- <el-option
- v-for="item in ifChiefList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </template>
- <template v-slot:status="{ row }">
- <DictSelection
- dictName="联系人状态"
- v-model="row.status"
- ></DictSelection>
- </template>
- <template v-slot:remark="{ row }">
- <el-input
- v-model="row.remark"
- placeholder="请输入"
- maxlength="50"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <!-- <el-tab-pane label="其他信息" :name="4">
- <headerTitle title="其他信息" style="margin-top: 30px"></headerTitle>
- <el-form
- label-width="100px"
- ref="otherForm"
- :model="otherForm"
- :rules="otherRules"
- style="margin-top: 30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="结算方式" prop="settlementMode">
- <DictSelection
- dictName="结算方式"
- clearable
- @itemChange="settlementModeChange"
- v-model="otherForm.settlementMode"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="税率">
- <el-input
- v-model="otherForm.taxRate"
- maxlength="5"
- oninput="value=value.replace(/[^0-9.]/g,'')"
- >
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="折扣率" prop="discount">
- <el-input
- v-model="otherForm.discount"
- maxlength="5"
- oninput="value=value.replace(/[^0-9.]/g,'')"
- >
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="收件人" prop="sender">
- <el-input
- placeholder="请输入"
- v-model="otherForm.sender"
- maxlength="50"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="收件人电话" prop="senderPhone">
- <el-input
- placeholder="请输入"
- v-model="otherForm.senderPhone"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-tab-pane> -->
- <el-tab-pane label="证书资质" name="4">
- <headerTitle title="证书资质" style="margin-top: 30px"></headerTitle>
- <certificateManagement
- ref="certificateManagementRef"
- ></certificateManagement>
- <!-- <ele-pro-table
- ref="certificateTable"
- :columns="certificateColumns"
- :need-page="false"
- :datasource="tableCertificateDataList"
- :toolkit="[]"
- height="350px"
- > -->
- <!-- 表头工具栏 -->
- <!-- <template v-slot:toolbar>
- <el-button type="primary" @click="addCertificate('add', '')"
- >新增</el-button
- >
- </template> -->
- <!-- 操作栏 -->
- <!-- <template v-slot:action="scope">
- <el-link
- v-if="[1, 2].includes(scope.row.processStatus)"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="addCertificate('view', scope.row, scope.$index)"
- >
- 详情
- </el-link>
- <el-link
- v-if="[0, 3].includes(scope.row.processStatus)"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="addCertificate('update', scope.row, scope.$index)"
- >
- 修改
- </el-link>
- <el-link
- v-if="
- [0, 3].includes(scope.row.processStatus) &&
- form.type == 1 &&
- form.qualificationCensorship == '2'
- "
- type="primary"
- :underline="false"
- icon="el-icon-plus"
- @click="submit(scope.row)"
- >
- 提交
- </el-link>
- <el-link
- v-if="[0, 3].includes(scope.row.processStatus) && (form.type == 2||form.type == 3)"
- type="primary"
- :underline="false"
- icon="el-icon-plus"
- @click="submit(scope.row)"
- >
- 提交
- </el-link>
- <el-popconfirm
- class="ele-action"
- title="确定要删除此资质吗?"
- @confirm="handleRemove(scope.row)"
- >
- <template v-slot:reference>
- <el-link
- v-if="[0, 3].includes(scope.row.processStatus)"
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- >
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table> -->
- </el-tab-pane>
- <el-tab-pane :label="getLabel" name="5">
- <headerTitle :title="getLabel" style="margin-top: 30px"></headerTitle>
- <ele-pro-table
- ref="supplyRef"
- :columns="supplyColumns"
- :need-page="false"
- :datasource="supplyList"
- :toolkit="[]"
- height="350px"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button type="primary" @click="handSelectSupply">新增</el-button>
- </template>
- <template v-slot:purchasingCycle="scope">
- <el-input v-model="scope.row.purchasingCycle" placeholder="请输入">
- <template slot="append">天</template>
- </el-input>
- </template>
- <template v-slot:purchaseMultiplier="scope">
- <el-input
- v-model="scope.row.purchaseMultiplier"
- placeholder="请输入"
- >
- </el-input>
- </template>
- <template v-slot:minimumOrderQuantity="scope">
- <el-input
- v-model="scope.row.minimumOrderQuantity"
- placeholder="请输入"
- >
- </el-input>
- </template>
- <template v-slot:provenance="scope">
- <DictSelection
- dictName="产地"
- clearable
- v-model="scope.row.provenance"
- multiple
- >
- </DictSelection>
- </template>
- <!-- 操作栏 -->
- <template v-slot:action="scope">
- <el-popconfirm
- class="ele-action"
- title="确定要删除此产品吗?"
- @confirm="handleRemoveSupply(scope.$index)"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- </el-tabs>
- <div slot="footer" class="footer">
- <el-button
- type="primary"
- @click="pageChange('up')"
- :disabled="activeName == '1'"
- >上一步</el-button
- >
- <el-button
- type="primary"
- @click="pageChange('next')"
- :disabled="activeName == '5'"
- >下一步</el-button
- >
- <el-button type="primary" v-if="form?.id||activeName == '5'" @click="save" v-click-once
- >保存</el-button
- >
- <el-button
- type="primary"
- v-if="
- form.type == 1 &&
- activeName == '5' &&
- contactApprovalEnabled
- "
- @click="save('sub')"
- v-click-once
- >提交</el-button
- >
- <el-button @click="cancel">返回</el-button>
- </div>
- <parentList
- ref="parentRef"
- classType="1"
- @changeParent="changeParent"
- ></parentList>
- <!-- 资质证书弹窗
- <certificate-qualifications-dialog
- :certificate-qualifications-dialog-flag.sync="
- certificateQualificationsDialogFlag
- "
- v-if="certificateQualificationsDialogFlag"
- ref="certificateQualificationsDialogRef"
- :contactInfo="form"
- :typeInfo="form.type"
- @success="tableCertificateDataAdd"
- @reload="reloadTableCertificateDataList"
- >
- </certificate-qualifications-dialog> -->
- <process-submit-dialog
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="reload"
- ></process-submit-dialog>
- <product-list
- ref="productListRef"
- :data="supplyList"
- @changeParent="getSupplyList"
- ></product-list>
- </ele-modal>
- </template>
- <script>
- import {
- contactDetail,
- contactSave,
- contactUpdate,
- // contactQcPackDeleteAPI,
- // identityphotoList,
- // contactQcPackPageAPI,
- contactQcPackSaveAPI
- } from '@/api/saleManage/contact';
- import { categoryData } from 'element-china-category-data';
- import fileUpload from '@/components/upload/fileUpload';
- import { cityData } from 'ele-admin/packages/utils/regions';
- import dictMixins from '@/mixins/dictMixins';
- import deptSelect from '@/components/CommomSelect/dept-select.vue';
- import personSelect from '@/components/CommomSelect/person-select.vue';
- import { listOrganizations } from '@/api/system/organization';
- import { copyObj } from '@/utils/util';
- import productList from '@/BIZComponents/product-list.vue';
- import parentList from './parentList.vue';
- // import certificateQualificationsDialog from '@/views/purchasingManage/supplierManage/components/certificateQualificationsDialog.vue';
- import certificateQualificationsDialog from './certificateQualificationsDialog.vue';
- import { reviewStatus, lbjtList } from '@/enum/dict';
- import { deepClone } from '@/utils';
- import searchTable from '@/views/saleManage/saleOrder/components/searchTable.vue';
- // import fileMain from '@/components/addDoc/index.vue';
- import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
- import certificateManagement from '@/views/saleManage/contact/components/certificateManagement/index.vue';
- import { parameterGetByCode } from '@/api/main/index.js';
- import { saveOrEdit } from '@/api/saleManage/contact';
- export default {
- props: {
- categoryTreeList: Array
- },
- mixins: [dictMixins],
- components: {
- processSubmitDialog,
- // fileMain,
- searchTable,
- certificateQualificationsDialog,
- fileUpload,
- deptSelect,
- personSelect,
- parentList,
- productList,
- certificateManagement
- },
- data() {
- let formDef = {
- objectType: 1,
- address: '',
- addressId: '',
- addressName: '',
- authorizationLimit: 0,
- businessLicenseFiles: [],
- businessLicenseFile: [],
- businessScope: '',
- categoryId: '',
- companyCategoryId: '',
- companyCategoryName: '',
- enterpriseTypeId: '',
- enterpriseTypeName: '',
- legalPerson: '',
- registeredCapital: '',
- parentId: '',
- industry: '',
- industryCode: '',
- industryFullName: '',
- mainProduct: '',
- name: '',
- officialIndustry: '',
- phone: '',
- registerDate: '',
- remark: '',
- serialNo: '',
- simpleName: '',
- type: 1,
- unifiedSocialCreditCode: '',
- enterpriseHonor: '',
- enterpriseScale: '',
- staffCount: '',
- enterpriseProfile: '',
- englishName: '',
- taxpayerQualification: '',
- qualificationCensorship: '2'
- };
- let otherFormDef = {
- settlementMode: '',
- settlementModeName: '',
- taxRate: 0,
- address: '',
- addressId: '',
- deptId: '',
- deptName: '',
- discount: 0,
- salesmanId: '',
- salesmanName: '',
- sender: '',
- senderPhone: ''
- };
- return {
- enableStatus: '2',
- contactApprovalEnabled: false,
- fullscreen: false,
- visible: false,
- certificateQualificationsDialogFlag: false,
- processSubmitDialogFlag: false,
- title: '',
- row: {},
- activeName: '1',
- formDef,
- editVersion: null,
- supplyList: [],
- otherFormDef,
- form: copyObj(formDef),
- otherForm: copyObj(otherFormDef),
- // removeBankList: [],
- // removeLinkList: [],
- tableBankData: [],
- tableLinkData: [],
- categoryIdList: [],
- dictList: {},
- ifChiefList: [
- {
- value: 0,
- label: '否'
- },
- {
- value: 1,
- label: '是'
- }
- ],
- bankColumns: [
- {
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '单位名称',
- prop: 'accountName',
- slot: 'accountName',
- action: 'accountName',
- headerSlot: 'accountNameHeader',
- align: 'center'
- },
- {
- label: '银行账号',
- prop: 'accountNo',
- slot: 'accountNo',
- action: 'accountNo',
- align: 'center'
- },
- {
- label: '开户行',
- prop: 'bankName',
- slot: 'bankName',
- action: 'bankName',
- align: 'center'
- },
- {
- label: '银行银联号',
- prop: 'interbankNo',
- slot: 'interbankNo',
- action: 'interbankNo',
- align: 'center'
- },
- {
- action: 'action',
- slot: 'action',
- label: '操作',
- align: 'center'
- }
- ],
- certificateColumns: [
- {
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '编码',
- prop: 'code',
- slot: 'code',
- align: 'center',
- minWidth: 120
- },
- {
- label: '名称',
- prop: 'name',
- slot: 'name',
- align: 'center',
- minWidth: 120
- },
- {
- label: '创建时间',
- prop: 'createTime',
- slot: 'createTime',
- align: 'center',
- minWidth: 120
- },
- {
- label: '状态',
- prop: 'processStatus',
- slot: 'processStatus',
- align: 'center',
- width: 120,
- formatter: (_row, _column, cellValue) => {
- return reviewStatus[_row.processStatus];
- }
- },
- {
- label: '备注',
- prop: 'remark',
- slot: 'remark',
- align: 'center',
- minWidth: 120
- },
- {
- action: 'action',
- slot: 'action',
- label: '操作',
- align: 'center',
- width: 200
- }
- ],
- otherRules: {
- // settlementMode: [
- // { required: true, message: '请输入结算方式', trigger: 'blur' }
- // ],
- address: [
- { required: false, message: '请选择地址', trigger: 'change' }
- ]
- },
- options: {
- cityData,
- categoryData
- },
- // 提交状态
- loading: false,
- // 是否是修改
- isUpdate: false,
- // 组织机构树形结构数据
- groupTreeData: [],
- // 组织机构平铺数据
- groupData: [],
- parentShow: false,
- tableCertificateDataList: []
- };
- },
- computed: {
- rules() {
- return {
- categoryId: [
- { required: true, message: '请选择分类', trigger: 'change' }
- ],
- name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
- unifiedSocialCreditCode: [
- {
- required: this.form.objectType == 1 ? true : false,
- message: '请输入统一社会信用代码',
- trigger: 'blur'
- }
- ],
- authorizationLimit: [
- { required: true, message: '请输入授信额度', trigger: 'blur' }
- ],
- // addressId: [
- // { required: true, message: '请选择地址', trigger: 'change' }
- // ],
- // qualificationCensorship: [
- // { required: true, message: '请选择', trigger: 'change' }
- // ]
- }
- },
- clientEnvironmentId() {
- return this.$store.state.user.info.clientEnvironmentId;
- },
- linkColumns() {
- return [
- {
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '姓名',
- prop: 'linkName',
- slot: 'linkName',
- action: 'linkName',
- headerSlot: 'linkNameHeader',
- align: 'center'
- },
- {
- label: '手机',
- prop: 'mobilePhone',
- slot: 'mobilePhone',
- action: 'mobilePhone',
- // headerSlot: 'mobilePhoneHeader',
- align: 'center'
- },
- {
- label: '电话',
- prop: 'phone',
- slot: 'phone',
- action: 'phone',
- align: 'center'
- },
- {
- label: '微信号',
- prop: 'wechat',
- slot: 'wechat',
- action: 'wechat',
- align: 'center'
- },
- {
- label: '邮箱',
- prop: 'email',
- slot: 'email',
- action: 'email',
- align: 'center'
- },
- {
- label: '部门',
- prop: 'deptName',
- slot: 'deptName',
- action: 'deptName',
- align: 'center'
- },
- {
- label: '职务',
- prop: 'post',
- slot: 'post',
- action: 'post',
- align: 'center'
- },
- {
- label: '状态',
- prop: 'status',
- slot: 'status',
- action: 'status',
- headerSlot: 'statusHeader',
- align: 'center'
- },
- {
- label: '是否首要',
- prop: 'ifChief',
- slot: 'ifChief',
- action: 'ifChief',
- align: 'center'
- },
- {
- label: `是否默认${this.form.type == 1 ? '收件' : '寄件'}人`,
- prop: 'isDefault',
- slot: 'isDefault',
- align: 'center'
- },
- {
- label: '备注',
- prop: 'remark',
- slot: 'remark',
- action: 'remark',
- align: 'center'
- },
- {
- action: 'action',
- slot: 'action',
- label: '操作',
- align: 'center'
- }
- ];
- },
- getLabel() {
- return this.categoryIdList
- .map((item) => {
- let data = this.$refs?.treeSelect?.getNodeByValue(item);
- return data?.rootCategoryLevelId;
- })
- .includes('20250317001')
- ? '生产列表'
- : '供货列表';
- },
- supplyColumns() {
- return [
- {
- columnKey: 'index',
- type: 'index',
- width: 50,
- align: 'center',
- showOverflowTooltip: true,
- label: '序号'
- },
- {
- prop: 'productCode',
- label: '编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'productName',
- label: '名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'purchasingCycle',
- label: '采购周期',
- align: 'center',
- slot: 'purchasingCycle',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'purchaseMultiplier',
- label: '倍数',
- slot: 'purchaseMultiplier',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100
- },
- {
- prop: 'minimumOrderQuantity',
- label: '最低订购数量',
- slot: 'minimumOrderQuantity',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'provenance',
- label: '产地',
- slot: 'provenance',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 200
- },
- {
- prop: 'manufacturer',
- label: '生产厂家',
- slot: 'manufacturer',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 200,
- show: this.getLabel == '供货列表'
- },
- {
- prop: 'imgCode',
- align: 'center',
- label: '图号/件号',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'produceType',
- align: 'center',
- label: '属性类型',
- showOverflowTooltip: true,
- minWidth: 110,
- formatter: (row, column) => {
- if (row.produceType) {
- return row.produceType
- .map((item) => {
- return lbjtList[item];
- })
- .toString();
- }
- }
- },
- {
- prop: 'packingSpecification',
- align: 'center',
- label: '包装规格',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'brandNum',
- align: 'center',
- label: '牌号',
- showOverflowTooltip: true
- },
- {
- prop: 'modelType',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'measuringUnit',
- label: '计量单位',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 90
- },
- {
- prop: 'createTime',
- label: '创建时间',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 160
- },
- {
- slot: 'action',
- align: 'center',
- minWidth: 90,
- fixed: 'right',
- label: '操作'
- }
- ];
- }
- },
- watch: {
- categoryIdList(val) {
- if (val.length > 0) {
- this.$refs.form?.clearValidate('categoryId');
- this.form.categoryId = this.categoryIdList.join(',');
- } else {
- this.form.categoryId = '';
- this.$refs.form?.validateField('categoryId');
- }
- }
- },
- created() {
- this.getGroupAll();
- this.requestDict('生产类型');
- parameterGetByCode({ code: 'contact_is_approval' }).then((res) => {
- this.contactApprovalEnabled = String(res.value) === '1';
- });
- },
- methods: {
- async open(type, row, contactCategoryId, pageType) {
- this.resetForm()
- this.editVersion = null;
- // return
- this.form.type = pageType || 1;
- this.title = type;
- this.row = row;
- this.visible = true;
- if (!row.id) {
- console.log('新增', this.form);
- this.isUpdate = false;
- // 默认带出列表页面选中的分类
- this.$nextTick(() => {
- this.categoryIdList = contactCategoryId ? [contactCategoryId] : [];
- // 客户审查 //2不启用 1启用
- parameterGetByCode({
- code: 'eom_saleManage_contact_qualificationCensorship'
- }).then((res) => {
- console.log('客户审查', res)
- this.form.qualificationCensorship = res.value;
- this.enableStatus = res.value
- });
- this.$refs.certificateManagementRef &&
- this.$refs.certificateManagementRef.init(
- this.form.type != 1
- ? this.getLabel == '供货列表'
- ? '3'
- : '6'
- : '4',
- this.form.id,
- this.form.name,
- true
- );
- });
- } else {
- this.isUpdate = true;
- await this._getById(row.id);
- }
- },
- handleActive(val) {
- console.log(val);
- },
- nameChange() {
- this.tableBankData.forEach((item) => {
- item.accountName = this.form.name;
- });
- },
- // 获取公司数据
- getGroupAll() {
- listOrganizations().then((list) => {
- this.groupData = list;
- this.groupTreeData = this.$util.toTreeData({
- data: list,
- idField: 'id',
- parentIdField: 'parentId'
- });
- });
- },
- // //新增/查看/修改资质
- // addCertificate(type, row, index) {
- // this.certificateQualificationsDialogFlag = true;
- // this.$nextTick(() => {
- // console.log(index);
- // this.$refs.certificateQualificationsDialogRef.init(type, row, index);
- // });
- // },
- // /* 证书资质表格数据源 */
- // tableCertificateData() {
- // contactQcPackPageAPI({
- // certificationType: this.form.type,
- // relationId: this.form.id
- // }).then((res) => {
- // this.tableCertificateDataList = res;
- // });
- // },
- // tableCertificateDataAdd({ form = {}, index = '' }) {
- // if (this.form.id) {
- // this.tableCertificateData();
- // } else {
- // if (index + '') {
- // this.$set(this.tableCertificateDataList, index, form);
- // } else {
- // this.tableCertificateDataList.push(form);
- // }
- // }
- // },
- // //删除资质包
- // handleRemove(row) {
- // contactQcPackDeleteAPI([row.id]).then((res) => {
- // this.$message.success('删除成功!');
- // this.tableCertificateDataAdd({});
- // });
- // },
- //开启提交流程
- async contactSubmit(row) {
- const { base } = await contactDetail(this.form.id || row);
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- businessId: base.id,
- businessKey: 'contact_approve',
- formCreateUserId: base.createUserId,
- variables: {
- certificationType: 1,
- businessCode: base.code,
- businessName: base.name,
- businessType: '客户审核'
- }
- };
- this.$refs.processSubmitDialogRef.init(params);
- });
- },
- //开启资质提交流程
- async submit(row) {
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- businessId: row.id,
- businessKey: 'contact_qc_approve',
- formCreateUserId: row.createUserId,
- variables: {
- certificationType: this.form.type,
- businessName: row.name
- }
- };
- this.$refs.processSubmitDialogRef.init(params);
- });
- },
- //获取代号
- unifiedSocialCreditCodeChange(val) {
- this.form.serialNo = this.form.serialNo || val.slice(-4);
- },
- // 选择负责人部门
- change_principalDep(id) {
- const info = this.groupData.find((e) => e.id == id);
- this.otherForm.deptName = info.name;
- this.otherForm.salesmanId = '';
- this.otherForm.salesmanName = '';
- // 根据部门获取人员
- const params = { groupId: id };
- this.$nextTick(() => {
- this.$refs.directorRef.getList(params);
- });
- },
- salesmanChange(val, info) {
- this.otherForm.salesmanName = info.name;
- },
- settlementModeChange(info) {
- this.otherForm.settlementModeName = info.dictValue;
- },
- ifChiefChange(value, idx) {
- if (value === 1) {
- this.tableLinkData.forEach((e) => (e.ifChief = 0));
- this.tableLinkData[idx].ifChief = 1;
- }
- },
- addBank() {
- this.tableBankData.push({
- accountName: this.form.name,
- accountNo: '',
- bankName: '',
- interbankNo: ''
- });
- },
- addLink() {
- this.tableLinkData.push({
- linkName: '',
- mobilePhone: '',
- phone: '',
- email: '',
- post: '',
- status: '1',
- ifChief: 0,
- remark: ''
- });
- },
- handleBankDel(row, index) {
- this.tableBankData.splice(index, 1);
- if (row?.id) {
- // this.removeBankList.push(row.id);
- }
- },
- handleLinkDel(row, index) {
- this.tableLinkData.splice(index, 1);
- if (row?.id) {
- // this.removeLinkList.push(row.id);
- }
- },
- formValid() {
- return new Promise((resolve, reject) => {
- this.$refs.form.validate((valid) => {
- if (!valid) {
- this.activeName = '1';
- reject(false);
- } else {
- resolve(true);
- }
- });
- });
- },
- otherFormValid() {
- return new Promise((resolve, reject) => {
- this.$refs.otherForm.validate((valid) => {
- console.log(valid, 'valid');
- if (!valid) {
- this.activeName = '1';
- reject(false);
- } else {
- resolve(true);
- }
- });
- });
- },
- tableLinkDataValid() {
- return new Promise((resolve, reject) => {
- if (this.tableLinkData.length == 0) {
- this.activeName = '3';
- this.$message.error('联系人信息至少有1条');
- reject(false);
- } else {
- resolve(true);
- }
- });
- },
- getValidate() {
- return Promise.all([
- this.formValid(),
- this.otherFormValid(),
- this.tableLinkDataValid()
- ]);
- },
- async pageChange(type) {
- if (type == 'up') {
- this.activeName = (parseInt(this.activeName) - 1).toString();
- }
- if (type == 'next') {
- if (this.activeName == '1' && !(await this.formValid())) {
- return;
- }
- if (this.activeName == '3' && !(await this.tableLinkDataValid())) {
- this.$message.error('联系人信息至少有1条');
- return;
- }
- // if (this.activeName == 4 && !(await this.otherFormValid())) {
- // return;
- // }
- this.activeName = (parseInt(this.activeName) + 1).toString();
- }
- },
- async save(type = '') {
- try {
- await this.getValidate();
- // 表单验证通过,执行保存操作
- this.loading = true;
- // 基本信息处理
- if (this.$refs.address.getCheckedNodes()) {
- let node = this.$refs.address.getCheckedNodes()[0];
- if (node) {
- this.form.addressId = node.path.join();
- this.form.addressName = node.pathLabels.join();
- } else {
- this.form.addressId = '';
- this.form.addressName = '';
- }
- }
- this.form.categoryId = this.categoryIdList.join(',');
- if (this.form.companyCategoryId) {
- this.form.companyCategoryName = this.getDictValue(
- '营业类型',
- this.form.companyCategoryId
- );
- }
- if (this.form.industryCode) {
- this.form.industryFullName = this.getDictValue(
- '所属行业',
- this.form.industryCode
- );
- }
- if (this.form.enterpriseTypeId) {
- this.form.enterpriseTypeName = this.getDictValue(
- '企业类型',
- this.form.enterpriseTypeId
- );
- }
- // if (
- // this.form.businessLicenseFiles &&
- // this.form.businessLicenseFiles.length > 0
- // ) {
- // this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
- // } else {
- // this.form.businessLicenseFile = null;
- // }
- // 其他信息处理
- if (this.form.settlementMode) {
- this.form.settlementModeName = this.getDictValue(
- '结算方式',
- this.form.settlementMode
- );
- }
- if (this.$refs.sendAddress.getCheckedNodes()) {
- let node = this.$refs.sendAddress.getCheckedNodes()[0];
- if (node) {
- this.otherForm.addressId = node.path.join();
- this.otherForm.addressName = node.pathLabels.join();
- } else {
- this.otherForm.addressId = '';
- this.otherForm.addressName = '';
- }
- }
- if (!this.isUpdate) {
- delete this.form.id;
- } else {
- // this.form.removeBankList = this.removeBankList;
- // this.form.removeLinkList = this.removeLinkList;
- }
- this.form.type =
- this.form.type != 1 ? (this.getLabel == '供货列表' ? '2' : '3') : 1;
- console.log(this.form, 'this.form~~~~~~~~');
- const data = {
- base: this.isUpdate ? { ...this.form, version: this.editVersion } : this.form,
- other: this.otherForm,
- bankList: this.tableBankData,
- linkList: this.tableLinkData,
- productList: this.supplyList
- };
- this.tableCertificateDataList = this.$refs.certificateManagementRef.getTableValue();
- if (this.isUpdate) {
- if (this.editVersion == null) {
- this.loading = false;
- this.$message.error('客户版本缺失,请刷新后重试');
- return;
- }
- contactUpdate(data)
- .then((res) => {
- this.loading = false;
- this.$message.success('修改成功');
- if (type == 'sub') {
- this.contactSubmit(res);
- return;
- }
- this.cancel();
- this.$emit('done');
- })
- .catch((e) => {
- //this.loading = false;
- });
- } else {
- contactSave(data)
- .then((id) => {
- this.loading = false;
- this.$message.success('新增成功');
- this.tableCertificateDataList.forEach((item) => {
- item['holderId'] = id;
- item['holder'] = this.form.name;
- saveOrEdit(item);
- });
- if (type == 'sub') {
- this.contactSubmit(id);
- return;
- }
- this.cancel();
- this._getById(id);
- this.title = '编辑';
- this.$emit('done');
- this.isUpdate = true;
- })
- .catch((e) => {
- //this.loading = false;
- });
- }
- } catch (error) {
- console.log(error);
- // 表单验证未通过,不执行保存操作
- }
- },
- reload() {
- this.cancel();
- this.$emit('done');
- },
- cancel() {
- this.$nextTick(() => {
- this.activeName = '1';
- // 关闭后,销毁所有的表单数据
- this.resetForm()
-
- this.visible = false;
- });
- },
- resetForm() {
- this.$set(this, 'form', copyObj(this.formDef));
- this.$set(this, 'otherForm', copyObj(this.otherFormDef));
- this.$set(this, 'tableBankData', []);
- this.$set(this, 'tableLinkData', []);
- this.$set(this, 'categoryIdList', []);
- this.$set(this, 'tableCertificateDataList', []);
- this.$set(this, 'supplyList', []);
- // this.form = copyObj(this.formDef);
- // this.otherForm = copyObj(this.otherFormDef);
- // this.tableBankData = [];
- // this.tableLinkData = [];
- // this.categoryIdList = [];
- // this.tableCertificateDataList = [];
- this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
- this.$refs['form'] && this.$refs['form'].resetFields();
- },
- async _getById(id) {
- const data = await contactDetail(id);
- this.form = data.base;
- this.editVersion = data.base.version;
- this.otherForm = data.other;
- this.tableBankData = data.bankList;
- this.tableLinkData = data.linkList;
- this.supplyList = data.productList || [];
- // this.tableCertificateDataAdd({});
- this.form.qualificationCensorship =
- this.form.qualificationCensorship || this.enableStatus || '2';
- // if (data.base.businessLicenseFile && data.base.businessLicenseFile.uid) {
- // this.$set(this.form, 'businessLicenseFiles', [
- // data.base.businessLicenseFile
- // ]);
- // }
- this.categoryIdList = this.form.categoryId
- ? deepClone(this.form.categoryId.split(','))
- : [];
- this.$nextTick(() => {
- this.$refs.certificateManagementRef &&
- this.$refs.certificateManagementRef.init(
- this.form.type != 1
- ? this.getLabel == '供货列表'
- ? '3'
- : '6'
- : '4',
- this.form.id,
- this.form.name
- );
- });
- if (this.tableLinkData && this.tableLinkData.length > 0) {
- this.tableLinkData.forEach((e) => (e.status = e.status + ''));
- }
- if (this.otherForm.settlementMode) {
- this.otherForm.settlementMode = this.otherForm.settlementMode + '';
- }
- if (this.form.level) {
- this.form.level = this.form.level + '';
- }
- // 回显地址选择器
- if (this.form.addressId && this.form.addressId.length > 0) {
- this.form.addressId = this.form.addressId.split(',');
- }
- if (this.otherForm.addressId && this.otherForm.addressId.length > 0) {
- this.otherForm.addressId = this.otherForm.addressId.split(',');
- }
- if (this.otherForm.deptId) {
- // 编辑时,默认查询组织相关的用户列表,用于回显
- this.$nextTick(async () => {
- await this.$refs.directorRef.getList({
- groupId: this.otherForm.deptId
- });
- });
- }
- },
- //选择产品
- handSelectSupply() {
- this.$refs.productListRef.open(this.supplyList, -1);
- },
- getSupplyList(obj) {
- obj.forEach((item, index) => {
- let params = {};
- this.$set(params, 'contactId', this.row.id);
- this.$set(params, 'productId', item.id);
- this.$set(params, 'categoryName', item.name);
- this.$set(params, 'productCategoryId', item.categoryLevelId);
- this.$set(params, 'productBrand', item.brandNum);
- this.$set(params, 'productCategoryName', item.categoryLevelPath);
- this.$set(params, 'productCode', item.code);
- this.$set(params, 'productName', item.name);
- this.$set(params, 'modelType', item.modelType);
- this.$set(params, 'availableCountBase', item.availableCountBase);
- this.$set(params, 'measuringUnit', item.measuringUnit);
- this.$set(params, 'specification', item.specification);
- this.$set(params, 'weightUnit', item.weightUnit);
- this.$set(params, 'imgCode', item.imgCode);
- this.$set(params, 'produceType', item.componentAttribute);
- this.$set(params, 'approvalNumber', item.approvalNumber);
- this.$set(params, 'packingSpecification', item.packingSpecification);
- if (item.purchaseOrigins?.length) {
- item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
- }
- this.$set(params, 'provenance', item.purchaseOrigins || []);
- this.supplyList.push(params);
- });
- },
- //删除供货产品
- handleRemoveSupply(index) {
- this.supplyList.splice(index, 1);
- },
- handParent() {
- let item = {
- id: this.form.parentId
- };
- this.$refs.parentRef.open(item);
- },
- changeParent(obj) {
- this.$set(this.form, 'parentId', obj.id);
- this.$set(this.form, 'parentName', obj.name);
- },
- changeAddress1(e) {
- if (e.length) {
- this.form.address = '/';
- return;
- }
- this.form.address = '';
- },
- changeAddress2(e) {
- if (e.length) {
- this.otherForm.address = '/';
- return;
- }
- this.otherForm.address = '';
- console.log(e);
- }
- }
- };
- </script>
|