1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003 |
- <template>
- <div>
- <div class="borderless">
- <div class="customer-head">
- <div class="customer-back">
- <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" size="small" @click="editCustomer">
- 保存数据
- </el-button>
- <el-button class="el-button--small-yh" :type="form.enableOrNot == 0 ? 'primary' : ''" size="small" v-if="form.id" @click="editEnable">
- {{ form.enableOrNot == 0 ? "启用" : "禁用" }}
- </el-button>
- </div>
- </div>
- <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
- <avue-form ref="form" class="trading-form" v-model="form" :option="option">
- <template slot="corpsTypeIdLabel">
- <span style="color: #409EFF;cursor: pointer" @click="corpTypeVisible = true">
- 客户分类
- </span>
- </template>
- <template slot="corpsTypeId">
- <avue-input-tree v-model="form.corpsTypeId" :disabled="option.disabled" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
- </avue-input-tree>
- </template>
- <tempalte slot="salesmanName">
- <dic-select
- v-model="form.salesmanName"
- placeholder="业务员"
- label="name"
- @selectChange="dicChange('salesmanName', $event)"
- :disabled="option.disabled"
- url="/blade-user/factoryUserList"
- :filterable="true"
- dataName="name"
- >
- </dic-select>
- </tempalte>
- <tempalte slot="deliveryWarehouseName">
- <dic-select
- v-model="form.deliveryWarehouseName"
- placeholder="发货仓库"
- label="cname"
- res="records"
- url="/gubersail-admin/storageDesc/list?current=1&size=5"
- :filterable="true"
- :remote="true"
- dataName="cname"
- @selectChange="dicChange('deliveryWarehouseName', $event)"
- :disabled="option.disabled"
- ></dic-select>
- </tempalte>
- <tempalte slot="label">
- <dic-select
- :key="labelKey"
- v-model="form.label"
- placeholder="门店标签"
- label="label"
- res="records"
- url="/gubersail-admin/corpslabel/list?current=1&size=5"
- :filterable="true"
- :remote="true"
- dataName="label"
- :disabled="option.disabled"
- ></dic-select>
- </tempalte>
- <tempalte slot="brandName">
- <dic-select
- v-model="form.brandName"
- placeholder="品牌"
- label="cname"
- url="/gubersail-admin/brandDesc/listAllV1?type=PP"
- :filterable="true"
- @selectChange="dicChange('brandName', $event)"
- :multiple="true"
- :disabled="option.disabled"
- dataType="string"
- ></dic-select>
- </tempalte>
- <template slot="labelLabel">
- <span style="color: #409EFF;cursor: pointer" @click="labelVisible = true">
- 门店标签
- </span>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="客户联系人" v-loading="loadingBtn">
- <avue-crud
- ref="crudTwo"
- :option="customerContactBack"
- v-model="contactsForm"
- :data="contactsData"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @row-del="rowDelTwo"
- >
- <template slot-scope="{ type, size, row, disabled, index }" slot="menu">
- <el-button
- :size="size"
- :disabled="disabled"
- :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.crudTwo.rowEdit(row, index)"
- >{{ row.$cellEdit ? "确认" : "修改" }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDelTwo(row, index)">删除 </el-button>
- <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户 </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <trade-card title="地址信息" v-loading="loadingBtn">
- <avue-crud :option="option2" ref="crud" :data="data" @row-save="rowSave" @row-update="rowUpdate">
- <template slot="headerSerial">
- <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow" :disabled="detailData.status == 1" circle></el-button>
- </template>
- <template slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addRow">录入明细 </el-button>
- </template>
- <template v-if="!row.$cellEdit" slot-scope="{ type, size, row, index, disabled }" slot="menu">
- <el-button
- :size="size"
- :disabled="disabled"
- :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.crud.rowCell(row, index)"
- >{{ row.$cellEdit ? "确认" : "修改" }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index)">删除 </el-button>
- </template>
- <template slot="defaultAddres" slot-scope="{ row, index, disabled }">
- <el-switch active-value="1" inactive-value="0" :disabled="disabled" v-model="row.defaultAddres" @change="addressUnique(row, index)">
- </el-switch>
- </template>
- </avue-crud>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload
- v-loading="loadingBtn"
- typeUpload="CD"
- deleteUrl="/api/gubersail-admin/corpsfiles/remove"
- :data="corpsFiles"
- display
- :enumerationValue="35.1"
- :disabled="detailData.status == 1"
- :mainImageType="true"
- ></c-upload>
- <el-dialog
- title="设置客户分类"
- v-dialogDrag
- :visible.sync="corpTypeVisible"
- class="avue-dialog"
- width="80%"
- append-to-body
- @closed="corpTypeClosed"
- >
- <span>
- <corp-type v-if="corpTypeVisible"></corp-type>
- </span>
- <div class="avue-dialog__footer">
- <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
- <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- <el-dialog title="设置门店标签" v-dialogDrag :visible.sync="labelVisible" class="avue-dialog" width="80%" append-to-body @closed="labelClosed">
- <span>
- <corp-label v-if="labelVisible"></corp-label>
- </span>
- <div class="avue-dialog__footer">
- <el-button @click="labelVisible = false" size="mini">取 消</el-button>
- <el-button @click="addLabel" type="primary" size="mini">确 定</el-button>
- </div>
- </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 {
- getDetails,
- getCorpType,
- submit,
- customerList,
- areaTypeTree,
- itemDel,
- corpsattn,
- editenable,
- getUserByRole,
- getBrandDesc,
- creatingUsersTwo
- } from "@/api/store/customerInformation";
- import { getRoleTree } from "@/api/system/role";
- import { getDeptTree } from "@/api/system/dept";
- import { getPostList } from "@/api/system/post";
- import corpType from "./components/index.vue";
- import corpLabel from "./components/label.vue";
- import website from "@/config/website";
- import dicSelect from "@/components/dicSelect/main.vue";
- import { getToken } from "@/util/auth";
- export default {
- name: "index",
- data() {
- return {
- labelKey: Date.now(),
- labelVisible: false,
- propsCk: {
- label: "cname",
- value: "id"
- },
- props: {
- label: "title",
- value: "value"
- },
- 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,
- formDataTwo: false,
- customerContact: {},
- contactsForm: {},
- contactsData: [],
- corpTypeList: [],
- corpTypeVisible: false,
- loadingBtn: false,
- form: {
- ifLimitAmount: "0"
- },
- form4: {},
- data: [],
- data2: [],
- option: {
- menuBtn: false,
- span: 6,
- column: [
- {
- label: "客户名称",
- prop: "cname",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ]
- },
- {
- label: "客户分类",
- prop: "corpsTypeId",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "电话",
- prop: "tel"
- },
- {
- label: "业务员",
- prop: "salesmanName",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "发货仓库",
- prop: "deliveryWarehouseName",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "商城价格",
- prop: "priceSystem",
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=mall_price",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "积分余额",
- prop: "pointsBalance",
- type: "number",
- controls: false,
- precision: 2,
- disabled: true
- },
- {
- label: "品牌",
- prop: "brandName",
- rules: [
- {
- message: "请选择品牌",
- trigger: "click"
- }
- ]
- },
- {
- label: "门店标签",
- prop: "label"
- },
- {
- label: "店面属性",
- prop: "storeAttributes"
- },
- {
- label: "连锁属性",
- prop: "chainAttribute"
- },
- {
- label: "签约级别",
- prop: "signingLevel"
- },
- {
- label: "签约条数",
- prop: "signingNumber"
- },
- {
- label: "签约期限起",
- prop: "signingPeriodStart",
- type: "month",
- format: "yyyy-MM",
- valueFormat: "yyyy-MM-01 00:00:00"
- },
- {
- label: "签约期限止",
- prop: "signingPeriodEnd",
- type: "month",
- format: "yyyy-MM",
- valueFormat: "yyyy-MM-01 00:00:00"
- },
- {
- label: "营业执照",
- prop: "businessLicenseUrl",
- type: "upload",
- listType: "picture-img",
- fileType: "img", //img/video/audio
- propsHttp: {
- res: "data",
- url: "link"
- },
- action: "/api/blade-resource/oss/endpoint/put-file",
- headers: { "Blade-Auth": "Bearer " + getToken() }
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 2,
- span: 24
- }
- ]
- },
- option2: {
- align: "center",
- index: true,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 300,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- addRowBtn: false,
- cellBtn: true,
- rowKey: "index",
- cancelBtn: false,
- columnBtn: false,
- // saveBtn:false,
- column: [
- {
- label: "联系人",
- prop: "contacts",
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "电话",
- prop: "tel",
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "地址",
- prop: "belongtoarea",
- dicData: [],
- dataType: "string",
- type: "cascader",
- props: {
- label: "name",
- value: "name"
- },
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ],
- filterable: true,
- cell: true
- },
- {
- label: "详细地址",
- prop: "detailedAddress",
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true
- },
- {
- label: "默认地址",
- prop: "defaultAddres",
- display: false,
- width: 100
- }
- ]
- },
- option3: {},
- option4: {
- menuBtn: false,
- labelWidth: 80,
- column: [
- {
- label: "分类名称",
- prop: "cname",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 24
- },
- {
- label: "上级类型",
- prop: "parentId",
- dicData: [],
- type: "tree",
- props: {
- label: "cname",
- value: "id"
- },
- span: 24
- }
- ]
- },
- corpsFiles: [],
- customerContactBack: {
- align: "center",
- index: true,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: true,
- span: 8,
- height: 300,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 200,
- dialogTop: 25,
- dialogWidth: "80%",
- columnBtn: false,
- column: [
- {
- label: "联系人",
- prop: "cname",
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "电话",
- prop: "tel",
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- // {
- // label: "登录用户id",
- // prop: "userId",
- // cell: true
- // },
- {
- label: "备注",
- prop: "remarks",
- cell: true
- }
- ]
- },
- userObj: {}
- };
- },
- components: { corpType, dicSelect, corpLabel },
- props: {
- detailData: {
- type: Object
- }
- },
- async created() {
- if (this.detailData.id) {
- this.getDetail(this.detailData.id);
- }
- if (this.detailData.status == 1) {
- this.option.disabled = true;
- }
- if (!website.tenantMode) {
- this.initData(website.tenantId);
- } else {
- this.initData();
- }
- this.getCorpType();
- this.getAllWorkDicts();
- this.userObj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
- },
- activated() {
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- }, 100);
- },
- methods: {
- dicChange(name, row) {
- if (name == "salesmanName") {
- if (row) {
- this.form.salesmanId = row.id;
- } else {
- this.form.salesmanId = null;
- this.form.salesmanName = null;
- }
- }
- if (name == "brandName") {
- if (row) {
- this.form.brandId = row.ids;
- this.form.brandName = row.names;
- } else {
- this.form.brandId = null;
- this.form.brandName = null;
- }
- }
- if (name == "deliveryWarehouseName") {
- if (row) {
- this.form.deliveryWarehouseId = row.id;
- } else {
- this.form.deliveryWarehouseId = null;
- this.form.deliveryWarehouseName = null;
- }
- }
- },
- // 启用或禁用
- editEnable() {
- let data = this.form;
- editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
- this.$message({
- type: "success",
- message: data.enableOrNot ? "禁用成功!" : "启用成功!"
- });
- this.getDetail(this.detailData.id);
- // this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
- });
- },
- addressUnique(row, index) {
- for (let item in this.data) {
- if (index != item) {
- if (this.data[item].defaultAddres == 1) {
- this.$message.warning("默认地址只能唯一");
- return (row.defaultAddres = 0);
- }
- }
- }
- },
- 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;
- });
- },
- //确认创建用户
- 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(",");
- creatingUsersTwo({
- ...data,
- id: this.formRow.id
- }).then(res => {
- this.dialogVisibleBt = false;
- this.formDataTwo = {};
- this.$message.success("创建用户成功,默认帐号:手机号。默认密码:123456");
- this.getDetail(this.form.id);
- });
- } else {
- return false;
- }
- });
- },
- getAllWorkDicts() {
- customerList({ corpType: "KH" }).then(res => {
- this.findObject(this.option4.column, "parentId").dicData = res.data.data.records;
- });
- this.findObject(this.option2.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem("areaTypeTree"))
- ? JSON.parse(localStorage.getItem("areaTypeTree"))
- : [];
- },
- getDetail(id) {
- this.loadingBtn = true;
- getDetails({ id: id })
- .then(res => {
- if (res.data.data.enableOrNot == 1) {
- this.$set(this.option, "disabled", true);
- } else {
- this.$set(this.option, "disabled", false);
- }
- this.data = res.data.data.corpsAddrList;
- this.corpsFiles = res.data.data.corpsFilesList;
- this.contactsData = res.data.data.corpsAttnList;
- this.form = res.data.data;
- })
- .finally(() => {
- this.loadingBtn = false;
- });
- },
- addRow() {
- this.data.push({ $cellEdit: true });
- },
- rowDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- itemDel(row.id).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data.splice(index, 1);
- });
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data.splice(index, 1);
- }
- });
- },
- addRow2() {
- this.data2.push({ $cellEdit: true, type: 1 });
- },
- rowCell2(row, index) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowDe2(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- // itemDel(row.id).then(res => {
- // this.$message({
- // type: "success",
- // message: "删除成功!"
- // });
- // this.data2.splice(index, 1);
- // });
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data2.splice(index, 1);
- }
- });
- },
- corpTypeClosed() {
- // this.reload = Math.random();
- // this.form4 = this.$options.data().form4
- },
- getCorpType() {
- getCorpType({ corpType: "KH" }).then(res => {
- this.corpTypeList = res.data.data;
- });
- },
- addCorpType() {
- this.getCorpType();
- this.corpTypeVisible = false;
- },
- addLabel() {
- this.labelKey = Date.now();
- this.labelVisible = false;
- },
- //修改提交触发
- editCustomer() {
- this.$refs.form.validate((valid, done) => {
- done();
- if (valid) {
- if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
- if (this.data.length == 0) return this.$message.error("请添加地址信息");
- if (this.corpsFiles.filter(item => item.mainImage == 1).length > 1) return this.$message.error("附件主图只允许选一个");
- this.loadingBtn = true;
- if (!this.form.id) {
- this.form.checkStatus = "通过";
- }
- submit({
- ...this.form,
- code: this.form.cname,
- corpType: "KH",
- corpsAddrList: this.data,
- corpsFilesList: this.corpsFiles,
- corpsAttnList: this.contactsData,
- billType: 1
- })
- .then(res => {
- this.$message.success("保存成功");
- this.form = res.data.data;
- this.data = res.data.data.corpsAddrList;
- this.corpsFiles = res.data.data.corpsFilesList;
- this.getDetail(res.data.data.id);
- if (!this.form.id) {
- //添加成功后默认启用
- let data = this.form;
- editenable({ id: res.data.data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
- this.$set(this.form, "enableOrNot", data.enableOrNot == 1 ? 0 : 1);
- });
- }
- })
- .finally(() => {
- this.loadingBtn = false;
- });
- } else {
- return false;
- }
- });
- },
- creatingUsers(row) {
- console.log("row", row);
- if (!row.id) {
- this.$message.error("请保存数据");
- }
- if (!row.cname || !row.tel) {
- this.$message.error("请完善联系人和电话");
- }
- if (!row.id) {
- this.$message.error("请保存数据");
- }
- if (row.userId) {
- this.$message.error("已创建,请勿重复操作");
- }
- this.$confirm("是否创建用户?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- creatingUsersTwo({
- id: row.id
- }).then(res => {
- this.$message.success("创建用户成功,默认帐号:手机号。默认密码:123456");
- this.getDetail(this.form.id);
- });
- });
- },
- //新增客户联系人保存触发
- rowSave(row, done, loading) {
- if (this.data.length == 1) {
- this.$set(row, "defaultAddres", "1");
- }
- done(row);
- },
- //修改客户联系人触发
- rowUpdate(row, index, done, loading) {
- done(row);
- },
- //删除客户联系人触发
- rowDelTwo(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);
- }
- });
- },
- //返回列表
- backToList() {
- this.$emit("goBack");
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-dialog__body {
- padding: 0px 20px 15px 20px;
- }
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- .el-dialog ::v-deep .el-form-item__error {
- display: none !important;
- }
- .img-form ::v-deep .el-form-item {
- height: 150px;
- line-height: 150px;
- margin-bottom: 8px !important;
- }
- .img-form ::v-deep .avue-upload__icon {
- font-size: 20px;
- width: 150px;
- height: 150px;
- line-height: 150px;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- .addressTabs {
- display: flex;
- justify-content: center;
- span {
- width: 100px;
- font-size: 18px;
- font-weight: 600;
- text-align: center;
- }
- }
- </style>
|