| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063 |
- <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="corpsTypeId">
- <div style="display:flex;">
- <avue-input-tree v-model="form.corpsTypeId" :disabled="option.disabled" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
- </avue-input-tree>
- <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
- @click="corpTypeVisible = true"></i>
- </div>
- </template>
- <template slot="deliveryWarehouseId">
- <div style="display:flex;">
- <avue-input-tree v-model="form.deliveryWarehouseId" :disabled="option.disabled" placeholder="请选择发货仓库" :dic="corpTypeListCk"
- :props="propsCk">
- </avue-input-tree>
- <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
- @click="dialogVisibleCK = true"></i>
- </div>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="客户联系人" v-loading="loadingBtn">
- <avue-crud ref="crudTwo" :option="customerContact" v-model="contactsForm" :data="contactsData"
- @saveColumn="saveColumnTwo" @resetColumn="resetColumnTwo" @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"
- @saveColumn="saveColumn" @resetColumn="resetColumn">
- <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="addRows">录入明细
- </el-button>
- </template> -->
- <template 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.rowEdit(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/blade-sales-part/corpsfiles/remove"
- :data="corpsFiles" display :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
- <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
- append-to-body @closed="corpTypeClosed">
- <span>
- <corp-type></corp-type>
- <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
- </avue-form> -->
- </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="创建用户" :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>
- <el-dialog title="新增仓库" :visible.sync="dialogVisibleCK" append-to-body width="60%">
- <avue-form v-if="dialogVisibleCK" ref="formDataThree" v-model="formDataThree" :option="optionDataCK">
- </avue-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleCK = false">取 消</el-button>
- <el-button type="primary" @click="confirmSynchronizationThree">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { option2, option3 } from "./js/optionList";
- // import {getDetails, addCorpType, getCorpType, submit, customerList, itemDel} from "@/api/basicData/client";
- import {
- getDetails,
- getCorpType,
- submit,
- customerList,
- itemDel,
- corpsattn,
- editenable
- } from "@/api/tirePartsMall/basicData/customerInformation"
- import corpType from './components/index'
- import { creatingUsersTwo } from "@/api/basicData/customerInformation";
- import { getRoleTree } from "@/api/system/role";
- import { getDeptTree } from "@/api/system/dept";
- import { getPostList } from "@/api/system/post";
- import website from "@/config/website";
- import {
- typeSave,
- customerListAll
- } from "@/api/tirePartsMall/basicData/warehouse";
- export default {
- name: "index",
- data() {
- return {
- 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"
- }
- ]
- }
- ]
- },
- optionDataCK: {
- span: 8,
- menuBtn: false,
- column: [{
- label: "仓库编码",
- prop: "code",
- search: true,
- overHidden: true,
- width: 120,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- }, {
- label: "仓库名称",
- prop: "cname",
- search: true,
- overHidden: true,
- width: 120,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- }, {
- label: "联系人",
- prop: "contacts",
- search: true,
- overHidden: true,
- width: 120,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- }, {
- label: "联系电话",
- prop: "tel",
- search: true,
- overHidden: true,
- width: 120,
- // rules: [
- // {
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }
- // ]
- }, {
- label: "是否计费",
- prop: "chargeOrNot",
- search: true,
- overHidden: true,
- width: 120,
- type: "select",
- dicData: [{
- label: "是",
- value: "0"
- }, {
- label: "否",
- value: "1"
- }],
- // rules: [
- // {
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }
- // ]
- }, {
- label: "库容",
- prop: "storageCapacity",
- search: true,
- overHidden: true,
- width: 120,
- // rules: [
- // {
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }
- // ]
- }, {
- label: "所属公司",
- prop: "salesCompanyId",
- search: true,
- overHidden: true,
- width: 120,
- type: 'select',
- props: {
- label: 'fullName',
- value: 'id'
- },
- dicUrl: '/api/blade-system/dept/top-list',
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- // {
- // label: "共享公司",
- // prop: "sharedCompany",
- // search: true,
- // overHidden: true,
- // width: 120,
- // rules: [
- // {
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }
- // ]
- // },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 3,
- span: 24,
- overHidden: true,
- width: 200
- }]
- },
- dialogVisibleBt: false,
- formDataTwo: false,
- dialogVisibleCK: false,
- formDataThree: false,
- customerContact: {},
- contactsForm: {},
- contactsData: [],
- corpTypeList: [],
- corpTypeListCk: [],
- corpTypeVisible: false,
- activeName: 'first',
- loadingBtn: false,
- addressTitle: null,
- addressVisible: false,
- form: {},
- form2: {},
- form3: {},
- form4: {},
- data: [],
- data1: [],
- data2: [],
- option: {
- menuBtn: false,
- labelWidth: 130,
- column: [
- {
- label: "客户名称",
- prop: "cname",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 8,
- },
- {
- label: "客户分类",
- prop: "corpsTypeId",
- span: 8,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: "电话",
- prop: "tel",
- span: 8,
- },
- {
- label: "业务员",
- span: 8,
- prop: "salesmanId",
- type: "select",
- props: {
- label: "name",
- value: "id"
- },
- dicUrl: "/api/blade-user/client/getUserByRole",
- filterable: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: "账期",
- prop: "accountPeriod",
- span: 8,
- },
- {
- label: "发货仓库",
- prop: "deliveryWarehouseId",
- span: 8,
- type: 'select',
- props: {
- label: 'cname',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/storageDesc/listAll',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: "商城价格",
- prop: "priceSystem",
- span: 8, 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:
- "creditLimit", span: 8,
- type: "number", controls: false,
- precision: 2
- }
- ,
- {
- label: "使用信用额度",
- prop: "useCreditLimit", span: 8,
- type: "number",
- disabled: true,
- controls: false,
- precision: 2
- }, {
- label: "备注",
- prop: "remarks", type: "textarea",
- minRows: 2, span: 24,
- }
- ]
- },
- option2: {},
- 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: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 200,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '联系人',
- prop: 'cname',
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- }, {
- label: '电话',
- prop: 'tel',
- cell: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- }, {
- label: '备注',
- prop: 'remarks',
- cell: true
- }]
- }
- }
- },
- components: {
- corpType
- },
- props: {
- detailData: {
- type: Object
- }
- },
- async created() {
- this.customerContact = await this.getColumnData(
- this.getColumnName(263.1),
- this.customerContactBack
- );
- this.option2 = await this.getColumnData(this.getColumnName(263.2), option2);
- // this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
- 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.getCorpTypeCk()
- },
- activated() {
- setTimeout(() => {
- this.$nextTick(() => {
- this.$refs.crud.doLayout()
- })
- }, 100)
- },
- methods: {
- // 启用或禁用
- 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"
- );
- });
- } else {
- return false;
- }
- });
- }
- ,
- //确认创建仓库
- confirmSynchronizationThree() {
- this.formDataThree.salesCompanyName = this.formDataThree.$salesCompanyId
- this.$refs["formDataThree"].validate((valid, done) => {
- done();
- if (valid) {
- typeSave({
- ...this.formDataThree,
- }).then(res => {
- this.dialogVisibleCK = false;
- this.$message.success('新增成功')
- this.formDataThree = {}
- this.getCorpTypeCk()
- });
- } else {
- return false;
- }
- });
- }
- ,
- getAllWorkDicts() {
- customerList({ corpType: "KH" }).then(res => {
- this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
- });
- this.getWorkDicts("abbreviation").then(res => {
- this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
- });
- this.findObject(this.option2.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
- this.$refs.crud.init();
- }
- ,
- cellStyle() {
- return "padding:0;height:40px;";
- }
- ,
- selectValue(value, row) {
- if (row.feesId) {
- row.feesName = value.cname
- } else {
- row.feesName = ""
- }
- }
- ,
- getDetail(id) {
- this.loadingBtn = true
- getDetails({ id: id })
- .then(res => {
- this.form = res.data.data;
- if (this.form.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
- })
- .finally(() => {
- this.loadingBtn = false;
- });
- }
- ,
- getCorpData(row) {
- this.form.corpName = row.cname
- }
- ,
- addRow() {
- console.log('1234');
- this.data.push({ $cellEdit: true })
- }
- ,
- rowCell(row, index) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$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
- })
- }
- ,
- getCorpTypeCk() {
- customerListAll().then(res => {
- this.corpTypeListCk = res.data.data
- })
- }
- ,
- addCorpType() {
- // this.$refs["corpType"].validate((valid, done) => {
- // done();
- // if (valid) {
- // addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
- // .then(res => {
- // this.$message.success("保存成功");
- // this.getCorpType()
- // this.corpTypeVisible = false
- // })
- // } else {
- // return false;
- // }
- // });
- this.getCorpType()
- this.corpTypeVisible = false
- }
- ,
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- this.loadingBtn = true;
- 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;
- }
- });
- }
- ,
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(263.2),
- this.option2
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- async resetColumn() {
- this.option2 = option2;
- const inSave = await this.delColumnData(
- this.getColumnName(263.2),
- option2
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- creatingUsers(row) {
- console.log("row", row)
- if (row.id) {
- if (row.tel) {
- this.dialogVisibleBt = true;
- this.formDataTwo = {};
- this.formRow = row;
- } else {
- this.$message.error("请输入手机号");
- }
- } else {
- this.$message.error("请保存数据后再点击");
- }
- }
- ,
- //新增客户联系人保存触发
- rowSave(row, done, loading) {
- 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);
- }
- });
- }
- ,
- async saveColumnTwo() {
- const inSave = await this.saveColumnData(
- this.getColumnName(263.1),
- this.customerContact
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crudTwo.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- async resetColumnTwo() {
- this.customerContact = this.customerContactBack;
- const inSave = await this.delColumnData(
- this.getColumnName(263.1),
- this.customerContactBack
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crudTwo.doLayout();
- });
- this.$message.success("重置成功");
- this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- async saveColumn2() {
- const inSave = await this.saveColumnData(
- this.getColumnName(208.4),
- this.option3
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud2.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- async resetColumn2() {
- this.option3 = option3;
- const inSave = await this.delColumnData(
- this.getColumnName(208.4),
- option3
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.crud2.$refs.dialogColumn.columnBox = false;
- }
- }
- ,
- //返回列表
- 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>
|