|
@@ -3,106 +3,108 @@
|
|
|
<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(0)">返回列表
|
|
|
+ @click="backToList(0)">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
<!-- <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"-->
|
|
|
<!-- @click="confirmEditing">编辑-->
|
|
|
<!-- </el-button>-->
|
|
|
- <el-button
|
|
|
- class="el-button--small-yh"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- @click="editCustomer">保存数据
|
|
|
+ <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- class="el-button--small-yh"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- v-if="form.id">启用
|
|
|
+ <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-top: 50px">
|
|
|
<trade-card title="基础信息">
|
|
|
- <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
|
|
|
+ <avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
+ <template slot="corpsTypeId">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择供货商分类" :dic="corpTypeList" :props="props">
|
|
|
+ </avue-input-tree>
|
|
|
+ <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
|
|
|
+ @click="corpTypeVisible = true"></i>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="联系人信息">
|
|
|
<avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.corpsAttnList"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @resetColumn="resetColumnTwo('formContacts','optionContacts','optionContactsBack',262.1)"
|
|
|
- @saveColumn="saveColumnTwo('formContacts','optionContacts','optionContactsBack',262.1)">
|
|
|
+ @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 262.1)"
|
|
|
+ @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 262.1)">
|
|
|
<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.formContacts.rowCell(row,index)"
|
|
|
- >{{ row.$cellEdit ? '确认' : '修改' }}
|
|
|
+ <el-button :size="size" :disabled="disabled" :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
|
|
|
- @click="rowDelBox(row,index)">删除
|
|
|
+ @click="rowDelBox(row, index)">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
<trade-card title="地址信息">
|
|
|
<avue-crud :option="optionAddress" v-model="formAddress" ref="formAddress" :data="form.corpsAddrList"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @resetColumn="resetColumnTwo('formContacts','optionAddress','optionAddressBack',262.2)"
|
|
|
- @saveColumn="saveColumnTwo('formContacts','optionAddress','optionAddressBack',262.2)">>
|
|
|
+ @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ @resetColumn="resetColumnTwo('formContacts', 'optionAddress', 'optionAddressBack', 262.2)"
|
|
|
+ @saveColumn="saveColumnTwo('formContacts', 'optionAddress', 'optionAddressBack', 262.2)">>
|
|
|
<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.formAddress.rowCell(row,index)"
|
|
|
- >{{ row.$cellEdit ? '确认' : '修改' }}
|
|
|
+ <el-button :size="size" :disabled="disabled" :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ @click="$refs.formAddress.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
|
|
|
- @click="rowDelBox(row,index)">删除
|
|
|
+ @click="rowDelBox(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 active-value="1" inactive-value="0" :disabled="disabled" v-model="row.defaultAddres"
|
|
|
+ @change="addressUnique(row, index)">
|
|
|
</el-switch>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
<trade-card title="附件信息">
|
|
|
- <c-upload
|
|
|
- basic
|
|
|
- :data="form.corpsFilesList"
|
|
|
- :disabled="disabled"
|
|
|
- deleteUrl="/api/blade-box-tube/shippingfile/remove"
|
|
|
- :enumerationValue="262.3"
|
|
|
- display
|
|
|
- />
|
|
|
+ <c-upload basic :data="form.corpsFilesList" :disabled="disabled"
|
|
|
+ deleteUrl="/api/blade-box-tube/shippingfile/remove" :enumerationValue="262.3" display />
|
|
|
</trade-card>
|
|
|
</div>
|
|
|
+ <el-dialog title="设置供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%" append-to-body
|
|
|
+ @closed="corpTypeClosed">
|
|
|
+ <span>
|
|
|
+ <corp-type corpType="GYS"></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>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
// import {detail, submit} from "@/api/basicData/shipManagement";
|
|
|
-import {getDetails, submit} from "@/api/tirePartsMall/basicData/customerInformation";
|
|
|
-
|
|
|
+import { getDetails, submit } from "@/api/tirePartsMall/basicData/customerInformation";
|
|
|
+import {getCorpType} from "@/api/tirePartsMall/basicData/customerInformation"
|
|
|
+import corpType from '@/components/corpType/index'
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ props: {
|
|
|
+ label: 'title',
|
|
|
+ value: 'value'
|
|
|
+ },
|
|
|
+ corpTypeList: [], //供货商列表
|
|
|
+ corpTypeVisible: false, //设置供应商分类
|
|
|
disabled: false,
|
|
|
form: {
|
|
|
- corpsAddrList:[],
|
|
|
- corpsAttnList:[],
|
|
|
- corpsFilesList:[]
|
|
|
+ corpsAddrList: [],
|
|
|
+ corpsAttnList: [],
|
|
|
+ corpsFilesList: []
|
|
|
},
|
|
|
optionForm: {
|
|
|
menuBtn: false,
|
|
@@ -110,6 +112,16 @@ export default {
|
|
|
column: [{
|
|
|
label: '全称',
|
|
|
prop: "cname",
|
|
|
+ span: 12,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '供货商分类',
|
|
|
+ prop: "corpsTypeId",
|
|
|
+ span: 12,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -117,11 +129,13 @@ export default {
|
|
|
}]
|
|
|
}, {
|
|
|
label: '电话',
|
|
|
- prop: "let"
|
|
|
+ prop: "let",
|
|
|
+ span: 12,
|
|
|
}, {
|
|
|
label: "业务员",
|
|
|
prop: "salesmanId",
|
|
|
type: "select",
|
|
|
+ span: 12,
|
|
|
props: {
|
|
|
label: "name",
|
|
|
value: "id"
|
|
@@ -217,6 +231,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ components: {
|
|
|
+ corpType
|
|
|
+ },
|
|
|
props: {
|
|
|
onLoad: Object,
|
|
|
detailData: Object
|
|
@@ -230,6 +247,7 @@ export default {
|
|
|
this.refresh(this.onLoad.id, true)
|
|
|
}
|
|
|
this.findObject(this.optionAddress.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
|
|
|
+ this.getCorpType()
|
|
|
},
|
|
|
methods: {
|
|
|
refresh(id, type) {
|
|
@@ -239,13 +257,37 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
})
|
|
|
- getDetails({id: id}).then(res => {
|
|
|
+ getDetails({ id: id }).then(res => {
|
|
|
this.form = res.data.data
|
|
|
loading.close();
|
|
|
}).catch(() => {
|
|
|
loading.close();
|
|
|
})
|
|
|
},
|
|
|
+ getCorpType() {
|
|
|
+ getCorpType({corpType: 'GYS'}).then(res => {
|
|
|
+ this.corpTypeList = 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()
|
|
@@ -288,18 +330,18 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- if (row.id) {
|
|
|
- // tradingBox(row.id).then(res => {
|
|
|
- // this.form.contactsList.splice(index, 1);
|
|
|
- // this.$message.success("操作成功!");
|
|
|
- // });
|
|
|
- } else {
|
|
|
- this.form.contactsList.splice(index, 1);
|
|
|
- this.$message.success("操作成功!");
|
|
|
- }
|
|
|
+ if (row.id) {
|
|
|
+ // tradingBox(row.id).then(res => {
|
|
|
+ // this.form.contactsList.splice(index, 1);
|
|
|
+ // this.$message.success("操作成功!");
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ this.form.contactsList.splice(index, 1);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
}
|
|
|
+ }
|
|
|
)
|
|
|
- ;
|
|
|
+ ;
|
|
|
},
|
|
|
rowSave(form, done, loading) {
|
|
|
done(form)
|