123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="68px"
- >
- <el-form-item label="客户类别" prop="fTypeid">
- <el-select
- style="width: 250px"
- v-model="queryParams.fTypeid"
- placeholder="请选择客户类别"
- clearable
- size="small"
- >
- <el-option
- v-for="(dict,index) in fTypeidOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="编号" prop="fNo">
- <el-input
- v-model="queryParams.fNo"
- style="width: 250px"
- placeholder="请输入编号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="名称" prop="fName">
- <el-input
- v-model="queryParams.fName"
- style="width: 250px"
- placeholder="请输入名称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="电话" prop="fTel">
- <el-input
- v-model="queryParams.fTel"
- style="width: 250px"
- placeholder="请输入电话"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="状态" prop="fStatus">
- <el-select
- v-model="queryParams.fStatus"
- placeholder="客户状态"
- clearable
- size="small"
- style="width: 250px"
- >
- <el-option
- v-for="(dict,index) in statusOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button
- type="cyan"
- icon="el-icon-search"
- size="mini"
- @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
- >重置</el-button
- >
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['basicdata:corps:add']"
- >新增</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['basicdata:corps:edit']"
- >修改</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['basicdata:corps:remove']"
- >删除</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['basicdata:corps:export']"
- >导出</el-button
- >
- </el-col>
- <div class="tabSetting">
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- <div style="margin: 0 12px">
- <el-tooltip
- class="item"
- effect="dark"
- content="列设置"
- placement="top"
- >
- <el-button
- icon="el-icon-setting"
- size="mini"
- circle
- @click="showSetting = !showSetting"
- ></el-button>
- </el-tooltip>
- </div>
- </div>
- </el-row>
- <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
- <div>配置排序列数据(拖动调整顺序)</div>
- <div style="margin-left: 17px">
- <el-checkbox
- v-model="allCheck"
- label="全选"
- @change="allChecked"
- ></el-checkbox>
- </div>
- <div style="padding: 4px; display: flex; justify-content: center">
- <draggable
- v-model="setRowList"
- group="site"
- animation="300"
- @start="onStart"
- @end="onEnd"
- handle=".indraggable"
- >
- <transition-group>
- <div
- v-for="item in setRowList"
- :key="item.surface"
- class="listStyle"
- >
- <div style="width: 500px" class="indraggable">
- <div class="progress" :style="{ width: item.width + 'px' }">
- <el-checkbox
- :label="item.name"
- v-model="item.checked"
- :true-label="0"
- :false-label="1"
- >{{ item.name }}
- </el-checkbox>
- </div>
- </div>
- <el-input-number
- v-model.number="item.width"
- controls-position="right"
- :min="1"
- :max="500"
- size="mini"
- ></el-input-number>
- </div>
- </transition-group>
- </draggable>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="showSetting = false">取 消</el-button>
- <el-button @click="delRow" type="danger">重 置</el-button>
- <el-button type="primary" @click="save()">确 定</el-button>
- </span>
- </el-dialog>
- <el-table
- v-loading="loading"
- :data="corpsList"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column
- v-for="(item, index) in getRowList"
- :key="index"
- :label="item.name"
- :width="item.width"
- :prop="item.label"
- align="center"
- :fixed="item.fixed"
- :show-overflow-tooltip="true"
- sortable
- />
- <!-- <el-table-column
- :show-overflow-tooltip="true"
- label="客户类别"
- align="center"
- prop="fTypename"
- />
- <el-table-column label="编号" align="center" prop="fNo" />
- <el-table-column
- :show-overflow-tooltip="true"
- label="名称"
- align="center"
- prop="fName"
- width="260px"
- />
- <el-table-column
- :show-overflow-tooltip="true"
- label="简称"
- align="center"
- width="200px"
- prop="fCname"
- />
- <el-table-column
- :show-overflow-tooltip="true"
- label="英文名称"
- align="center"
- prop="fEname"
- />
- <el-table-column
- :show-overflow-tooltip="true"
- label="电话"
- align="center"
- prop="fTel"
- />
- <el-table-column label="录入人" align="center" prop="createBy" />
- <el-table-column
- label="录入时间"
- align="center"
- prop="createTime"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column label="修改人" align="center" prop="updateBy" />
- <el-table-column
- label="修改时间"
- align="center"
- prop="updateTime"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="状态" align="center" prop="fStatus">
- <template slot-scope="scope">
- <el-switch
- v-model="scope.row.fStatus"
- active-value="0"
- inactive-value="1"
- v-hasPermi="['basicdata:corps:edit']"
- @change="handleStatusChange(scope.row)"
- ></el-switch>
- </template>
- </el-table-column>
- <el-table-column
- label="备注"
- align="center"
- prop="remark"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="150"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['basicdata:corps:edit']"
- >修改</el-button
- >
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['basicdata:corps:remove']"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改客户详情对话框 -->
- <el-dialog
- v-dialogDrag
- :fullscreen="dialogFull"
- :title="title"
- :visible.sync="open"
- width="80%"
- :close-on-click-modal="false"
- append-to-body
- >
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="
- display: inline-block;
- width: 3px;
- height: 20px;
- margin-right: 5px;
- float: left;
- margin-top: 2px;
- "
- ></span>
- 添加客户详情
- </span>
- <div class="avue-crud__dialog__menu enlarge" @click="full">
- <i
- style="
- cursor: pointer;
- display: block;
- width: 12px;
- height: 12px;
- border: 1px solid #909399;
- border-top: 3px solid #909399;
- margin-top: -3px;
- "
- ></i>
- </div>
- </div>
- </template>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="客户类别" prop="fTypeid">
- <el-select
- style="width: 250px"
- v-model="form.fTypeid"
- :multiple="true"
- placeholder="请选择客户类别"
- :disabled="disCorps"
- >
- <el-option
- v-for="(dict,index) in fTypeidOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="编号" prop="fNo">
- <el-input
- v-model="form.fNo"
- style="width: 250px"
- placeholder="请输入编号"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="名称" prop="fName">
- <el-input
- v-model="form.fName"
- style="width: 250px"
- placeholder="请输入名称"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="简称" prop="fCname">
- <el-input
- v-model="form.fCname"
- style="width: 250px"
- placeholder="请输入简称"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="电话" prop="fTel">
- <el-input
- v-model="form.fTel"
- style="width: 250px"
- placeholder="请输入电话"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="*归属部门" prop="deptId">
- <treeselect
- :multiple="true"
- :options="deptOptions"
- placeholder="请选择归属部门"
- v-model="form.deptId"
- style="width: 250px; line-height: 20px"
- />
- </el-form-item>
- <!-- <treeselect-value :value="treevalue" /> -->
- </el-col>
- </el-row>
- <el-row>
- <div style="display: flex; justify-content: flex-end">
- <el-button style="margin: 10px" @click="showForm = !showForm"
- >{{ showForm ? "隐藏" : "更多" }}
- </el-button>
- </div>
- </el-row>
- <div v-if="showForm">
- <el-row>
- <el-col :span="8">
- <el-form-item label="英文名称" prop="fEname">
- <el-input
- v-model="form.fEname"
- style="width: 250px"
- placeholder="请输入英文名称"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="邮箱" prop="fEmail">
- <el-input
- v-model="form.fEmail"
- style="width: 250px"
- placeholder="请输入邮箱"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="联系人" prop="fManage">
- <el-input
- v-model="form.fManage"
- style="width: 250px"
- placeholder="请输入联系人"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="传真" prop="fFax">
- <el-input
- v-model="form.fFax"
- style="width: 250px"
- placeholder="请输入传真"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="地址" prop="fAddr">
- <el-input
- v-model="form.fAddr"
- style="width: 250px"
- placeholder="请输入地址"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="英文地址" prop="fEaddr">
- <el-input
- v-model="form.fEaddr"
- style="width: 250px"
- placeholder="请输入英文地址"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="规模" prop="fScale">
- <el-input
- v-model="form.fScale"
- style="width: 250px"
- placeholder="请输入规模"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="省" prop="fProvince">
- <el-input
- v-model="form.fProvince"
- style="width: 250px"
- placeholder="请输入省"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="市" prop="fCity">
- <el-input
- v-model="form.fCity"
- style="width: 250px"
- placeholder="请输入市"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="结算方式" prop="fStltypeid">
- <el-select
- v-model="form.fStltypeid"
- style="width: 250px"
- placeholder="请选择结算表票结、月结"
- >
- <el-option
- v-for="(dict,index) in fStltypeidOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="结费天数" prop="fStldays">
- <el-input
- v-model="form.fStldays"
- style="width: 250px"
- placeholder="请输入结费天数"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="税号" prop="fTax">
- <el-input
- v-model="form.fTax"
- style="width: 250px"
- placeholder="请输入税号"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="合同号" prop="fContractno">
- <el-input
- v-model="form.fContractno"
- style="width: 250px"
- placeholder="请输入合同号"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="合同起" prop="fContractb">
- <el-date-picker
- clearable
- size="small"
- style="width: 250px"
- v-model="form.fContractb"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择合同起"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="合同至" prop="fContracte">
- <el-date-picker
- clearable
- size="small"
- style="width: 250px"
- v-model="form.fContracte"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择合同至"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="开票电话" prop="fInvtel">
- <el-input
- v-model="form.fInvtel"
- style="width: 250px"
- placeholder="请输入开票电话"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="开票地址" prop="fInvaddr">
- <el-input
- v-model="form.fInvaddr"
- style="width: 250px"
- placeholder="请输入开票地址"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="本位币账号" prop="fBankno" label-width="100">
- <el-input
- v-model="form.fBankno"
- style="width: 250px"
- placeholder="请输入本位币账号"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item
- label="本位币银行"
- label-width="100"
- prop="fBankname"
- >
- <el-input
- v-model="form.fBankname"
- style="width: 250px"
- placeholder="请输入本位币银行"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="外币账号" prop="fUbankno">
- <el-input
- v-model="form.fUbankno"
- style="width: 250px"
- placeholder="请输入外币账号"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="外币银行" prop="fUbankname">
- <el-input
- v-model="form.fUbankname"
- style="width: 250px"
- placeholder="请输入外币银行"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="状态">
- <!--<el-radio-group v-model="form.fStatus">
- <el-radio label="1">请选择字典生成</el-radio>
- </el-radio-group>-->
- <el-radio-group v-model="form.fStatus">
- <el-radio
- v-for="(dict,index) in statusOptions"
- :key="index.dictValue"
- :label="dict.dictValue"
- >{{ dict.dictLabel }}</el-radio
- >
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="备注" prop="remark">
- <el-input
- v-model="form.remark"
- style="width: 400px"
- placeholder="请输入备注"
- />
- </el-form-item>
- </div>
- </el-form>
- <div>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="addRow(contactList)"
- >添加</el-button
- >
- </el-col>
- </el-row>
- </div>
- <el-table
- v-loading="loading"
- :data="contactList"
- @selection-change="handleSelectionChange"
- >
- <el-table-column label="编号" align="center" prop="fNo">
- <template slot-scope="scope">
- <el-input v-model="scope.row.fNo" placeholder="编号" />
- </template>
- </el-table-column>
- <el-table-column label="昵称" align="center" prop="fName">
- <template slot-scope="scope">
- <el-input v-model="scope.row.fName" placeholder="昵称" />
- </template>
- </el-table-column>
- <el-table-column label="英文名称" align="center" prop="fEname">
- <template slot-scope="scope">
- <el-input v-model="scope.row.fEname" placeholder="英文名称" />
- </template>
- </el-table-column>
- <el-table-column label="用户名称/密码" align="center" prop="fTel">
- <template slot-scope="scope">
- <el-input v-model="scope.row.fTel" placeholder="用户名称/密码"/>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="fStatus">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fStatus"
- placeholder="状态"
- clearable
- size="small"
- >
- <el-option
- v-for="(dict,index) in statusOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center" prop="remark">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark" placeholder="备注" />
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="100"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click.native.prevent="deleteRow(scope.$index, contactList)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <up-load
- :relevantAttachments="relevantAttachments"
- :createBy="username"
- ></up-load>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listCorps,
- getCorps,
- delCorps,
- addCorps,
- updateCorps,
- changeCorpsStatus,
- exportCorps,
- } from "@/api/basicdata/corps";
- import { queryUserVal } from "@/api/system/user";
- import { isArray } from "@/utils/validate";
- import { addSet, select, resetModule } from "@/api/system/set";
- import Cookies from "js-cookie";
- import draggable from "vuedraggable";
- import { treeselect } from "@/api/system/dept";
- import upLoad from "@/views/Warehousing/components/upLoad";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import Vue from "vue";
- Vue.directive("dialogDrag", {
- bind(el, binding, vnode, oldVnode) {
- const dialogHeaderEl = el.querySelector(".el-dialog__header");
- const dragDom = el.querySelector(".el-dialog");
- const enlarge = el.querySelector(".enlarge");
- dialogHeaderEl.style.cursor = "move";
- // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
- const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
- if (enlarge) {
- enlarge.onclick = (e) => {
- dragDom.style.top = "0px";
- dragDom.style.left = "0px";
- };
- }
- dialogHeaderEl.onmousedown = (e) => {
- // 鼠标按下,计算当前元素距离可视区的距离
- const disX = e.clientX - dialogHeaderEl.offsetLeft;
- const disY = e.clientY - dialogHeaderEl.offsetTop;
- // 获取到的值带px 正则匹配替换
- let styL, styT;
- // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
- if (sty.left.includes("%")) {
- styL =
- +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
- styT =
- +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
- } else {
- styL = +sty.left.replace(/\px/g, "");
- styT = +sty.top.replace(/\px/g, "");
- }
- document.onmousemove = function (e) {
- // 通过事件委托,计算移动的距离
- const l = e.clientX - disX;
- const t = e.clientY - disY;
- // 移动当前元素
- if (t + styT >= 0) {
- dragDom.style.top = `${t + styT}px`;
- }
- dragDom.style.left = `${l + styL}px`;
- // 将此时的位置传出去
- // binding.value({x:e.pageX,y:e.pageY})
- };
- document.onmouseup = function (e) {
- document.onmousemove = null;
- document.onmouseup = null;
- };
- };
- },
- });
- export default {
- name: "Corps",
- components: { draggable, Treeselect, upLoad },
- data() {
- return {
- treevalue: null,
- deptOptions: null,
- disCorps: false,
- //全屏放大
- dialogFull: false,
- contactList: [],
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 客户详情表格数据
- corpsList: [],
- // 弹出层标题
- title: "",
- // 状态数据字典
- statusOptions: [],
- // 是否显示弹出层
- open: false,
- // 客户类别字典
- fTypeidOptions: [],
- // 结算表票结、月结字典
- fStltypeidOptions: [],
- // 删除状态字典
- delFlagOptions: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fTypeid: null,
- fNo: null,
- fName: null,
- fCname: null,
- fEname: null,
- fTel: null,
- fFax: null,
- fEmail: null,
- fManage: null,
- fAddr: null,
- fEaddr: null,
- fScale: null,
- fProvince: null,
- fCity: null,
- fStltypeid: null,
- fStldays: null,
- fContractno: null,
- fContractb: null,
- fContracte: null,
- fTax: null,
- fInvtel: null,
- fInvaddr: null,
- fBankno: null,
- fBankname: null,
- fUbankno: null,
- fUbankname: null,
- fStatus: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- fTypeid: [
- { required: true, message: "客户类别不能为空", trigger: "blur" },
- ],
- fNo: [{ required: true, message: "编号不能为空", trigger: "blur" }],
- fName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
- fCname: [{ required: true, message: "简称不能为空", trigger: "blur" }],
- fStatus: [
- {
- required: true,
- message: "状态默认 T ,正常T 停用F 下拉选择不能为空",
- trigger: "blur",
- },
- ],
- },
- showSetting: false,
- drag: false,
- setRowList: [],
- getRowList: [],
- tableDate: [
- {
- surface: "1",
- label: "fTypename",
- name: "客户类别",
- checked: 0,
- width: 100,
- },
- {
- surface: "2",
- label: "fNo",
- name: "编号",
- checked: 0,
- width: 100,
- },
- {
- surface: "3",
- label: "fName",
- name: "名称",
- checked: 0,
- width: 100,
- },
- {
- surface: "4",
- label: "fCname",
- name: "简称",
- checked: 0,
- width: 100,
- },
- {
- surface: "5",
- label: "fEname",
- name: "英文名称",
- checked: 0,
- width: 100,
- },
- {
- surface: "6",
- label: "fTel",
- name: "电话",
- checked: 0,
- width: 100,
- },
- {
- surface: "7",
- label: "createBy",
- name: "录入人",
- checked: 0,
- width: 100,
- },
- {
- surface: "8",
- label: "createTime",
- name: "录入时间",
- checked: 0,
- width: 100,
- },
- {
- surface: "9",
- label: "updateBy",
- name: "修改人",
- checked: 0,
- width: 100,
- },
- {
- surface: "10",
- label: "updateTime",
- name: "修改时间",
- checked: 0,
- width: 100,
- },
- {
- surface: "11",
- label: "sendTime",
- name: "提交日期",
- checked: 0,
- width: 100,
- },
- ],
- allCheck: false,
- showForm: false,
- relevantAttachments: [],
- username:null,
- };
- },
- created() {
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- this.getList();
- this.getDicts("data_customer_category").then((response) => {
- this.fTypeidOptions = response.data;
- });
- this.getDicts("data_stltype_type").then((response) => {
- this.fStltypeidOptions = response.data;
- });
- this.getDicts("data_delete_state").then((response) => {
- this.delFlagOptions = response.data;
- });
- this.getDicts("sys_normal_disable").then((response) => {
- this.statusOptions = response.data;
- });
- this.getRow();
- this.getTreeselect();
- this.username = Cookies.get("userName");
- },
- methods: {
- getTreeselect() {
- treeselect().then((response) => {
- this.deptOptions = response.data;
- });
- },
- //列设置全选
- allChecked() {
- if (this.allCheck == true) {
- this.setRowList.map((e) => {
- return (e.checked = 0);
- });
- } else {
- this.setRowList.map((e) => {
- return (e.checked = 1);
- });
- }
- },
- //查询列数据
- getRow() {
- let that = this;
- this.data = {
- tableName: "客户信息",
- userId: Cookies.get("userName"),
- };
- select(this.data).then((res) => {
- if (res.data.length != 0) {
- this.getRowList = res.data.filter((e) => e.checked == 0);
- this.setRowList = res.data;
- this.setRowList = this.setRowList.reduce((res, item) => {
- res.push({
- surface: item.surface,
- label: item.label,
- name: item.name,
- checked: item.checked,
- width: item.width,
- fixed: item.fixed,
- });
- return res;
- }, []);
- }
- });
- },
- //重置列表
- delRow() {
- this.data = {
- tableName: "客户信息",
- userId: Cookies.get("userName"),
- };
- resetModule(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- }
- });
- },
- //保存列设置
- save() {
- this.showSetting = false;
- this.data = {
- tableName: "客户信息",
- userId: Cookies.get("userName"),
- sysTableSetList: this.setRowList,
- };
- addSet(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
- }
- });
- },
- //开始拖拽事件
- onStart() {
- this.drag = true;
- },
- //拖拽结束事件
- onEnd() {
- this.drag = false;
- },
- full() {
- this.dialogFull = !this.dialogFull;
- },
- // 客户类别默认为客户结算方式默认月结
- query() {
- this.$set(this.form, "fStltypeid", 1);
- },
- // 添加行
- addRow(tableData, event) {
- var obj = {};
- tableData.push(obj);
- },
- //删除行
- deleteRow(index, rows) {
- rows.splice(index, 1);
- },
- /** 查询客户详情列表 */
- getList() {
- this.loading = true;
- listCorps(this.queryParams).then((response) => {
- this.corpsList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 客户类别字典翻译
- fTypeidFormat(row, column) {
- return this.selectDictLabel(this.fTypeidOptions, row.fTypeid);
- },
- // 结算表票结、月结字典翻译
- fStltypeidFormat(row, column) {
- return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid);
- },
- // 删除状态字典翻译
- delFlagFormat(row, column) {
- return this.selectDictLabel(this.delFlagOptions, row.delFlag);
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- fId: null,
- fTypeid: null,
- fNo: null,
- fName: null,
- fCname: null,
- fEname: null,
- fTel: null,
- fFax: null,
- fEmail: null,
- fManage: null,
- fAddr: null,
- fEaddr: null,
- fScale: null,
- fProvince: null,
- fCity: null,
- fStltypeid: null,
- fStldays: null,
- fContractno: null,
- fContractb: null,
- fContracte: null,
- fTax: null,
- fInvtel: null,
- fInvaddr: null,
- fBankno: null,
- fBankname: null,
- fUbankno: null,
- fUbankname: null,
- fStatus: null,
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- remark: null,
- };
- this.contactList = [];
- this.resetForm("form");
- },
- // 状态修改
- handleStatusChange(row) {
- let text = row.fStatus === "0" ? "启用" : "停用";
- this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return changeCorpsStatus(row.fId, row.fStatus);
- })
- .then(() => {
- this.msgSuccess(text + "成功");
- })
- .catch(function () {
- row.fStatus = row.fStatus === "0" ? "1" : "0";
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.contactList = [];
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map((item) => item.fId);
- this.single = selection.length !== 1;
- this.multiple = !selection.length;
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.query();
- this.contactList = [];
- if (Cookies.get("sysType") == 2) {
- this.form.fTypeid = [this.fTypeidOptions[0].dictValue];
- this.disCorps = true;
- }
- this.open = true;
- this.title = "添加客户详情";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- if (Cookies.get("sysType") == 2) {
- this.disCorps = true;
- }
- const fId = row.fId || this.ids;
- getCorps(fId).then((response) => {
- if (response.data.corp.deptId) {
- response.data.corp.deptId = response.data.corp.deptId
- .replace(/\[|]/g, "")
- .replace(/\"/g, "")
- .split(",");
- }
- this.relevantAttachments = response.data["attach"]? response.data["attach"]: [];
- this.form = response.data["corp"];
- console.log(this.form);
- var contactList1 = response.data["customerContact"];
- this.form.fTypeid = this.form.fTypeid
- .replace(/\[|]/g, "")
- .replace(/\"/g, "")
- .split(",");
- if (contactList1 != null) {
- this.contactList = contactList1;
- } else {
- this.query();
- }
- this.open = true;
- this.title = "修改客户详情";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.form.fTypename = "";
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (!this.form.deptId) {
- return this.$message.error("归属部门不能为空");
- }
- if (this.form.fId != null) {
- let formDate = new FormData();
- for (let index in this.fTypeidOptions) {
- for (let item in this.form.fTypeid) {
- if (
- this.fTypeidOptions[index].dictValue ==
- this.form.fTypeid[item]
- ) {
- this.form.fTypename +=
- this.fTypeidOptions[index].dictLabel + ",";
- }
- }
- }
- this.form.fTypename = this.form.fTypename.substring(
- 0,
- this.form.fTypename.length - 1
- );
- if (this.contactList.length == 0 && Cookies.get("sysType") == 2) {
- return this.$message.error("联系人不能为空");
- }
- formDate.append("corps", JSON.stringify(this.form));
- formDate.append(
- "customerContacts",
- JSON.stringify(this.contactList)
- );
- formDate.append(
- "attach",
- JSON.stringify(this.relevantAttachments)
- );
- addCorps(formDate).then((response) => {
- console.log("111");
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- let formDate = new FormData();
- for (let index in this.fTypeidOptions) {
- for (let item in this.form.fTypeid) {
- if (
- this.fTypeidOptions[index].dictValue ==
- this.form.fTypeid[item]
- ) {
- this.form.fTypename +=
- this.fTypeidOptions[index].dictLabel + ",";
- }
- }
- }
- this.form.fTypename = this.form.fTypename.substring(
- 0,
- this.form.fTypename.length - 1
- );
- if (this.contactList.length == 0 && Cookies.get("sysType") == 2) {
- return this.$message.error("联系人不能为空");
- }
- formDate.append("corps", JSON.stringify(this.form));
- formDate.append(
- "customerContacts",
- JSON.stringify(this.contactList)
- );
- formDate.append(
- "attach",
- JSON.stringify(this.relevantAttachments)
- );
- addCorps(formDate).then((response) => {
- this.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const fIds = row.fId || this.ids;
- this.$confirm(
- '是否确认删除客户详情编号为"' + fIds + '"的数据项?',
- "警告",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(function () {
- return delCorps(fIds);
- })
- .then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm("是否确认导出所有客户详情数据项?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return exportCorps(queryParams);
- })
- .then((response) => {
- this.download(response.msg);
- });
- },
- },
- };
- </script>
- <style lang="scss">
- .avue-crud__dialog__header {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- justify-content: space-between;
- }
- .el-dialog__title {
- color: rgba(0, 0, 0, 0.85);
- font-weight: 500;
- word-wrap: break-word;
- }
- .avue-crud__dialog__menu {
- padding-right: 20px;
- float: left;
- }
- .avue-crud__dialog__menu i {
- color: #909399;
- font-size: 15px;
- }
- .el-icon-full-screen {
- cursor: pointer;
- }
- .el-icon-full-screen:before {
- content: "\e719";
- }
- </style>
- <style lang="scss" scoped>
- .tabSetting {
- display: flex;
- justify-content: flex-end;
- }
- .listStyle {
- display: flex;
- border-top: 1px solid #dcdfe6;
- border-left: 1px solid #dcdfe6;
- border-right: 1px solid #dcdfe6;
- }
- .listStyle:last-child {
- border-bottom: 1px solid #dcdfe6;
- }
- .progress {
- display: flex;
- align-items: center;
- padding: 2px;
- background-color: rgba(0, 0, 0, 0.05);
- height: 100%;
- }
- .el-form-item__content {
- line-height: 20px !important;
- }
- </style>
|