|
@@ -17,10 +17,10 @@
|
|
|
<avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
<template slot="corpsTypeId">
|
|
|
<div style="display:flex;">
|
|
|
- <avue-input-tree default-expand-all v-model="form.corpsTypeId"
|
|
|
- placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
|
|
|
+ <avue-input-tree v-model="form.corpsTypeId" 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"
|
|
|
+ <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
|
|
|
@click="corpTypeVisible = true"></i>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -28,19 +28,19 @@
|
|
|
</trade-card>
|
|
|
<trade-card title="地址管理" v-loading="loadingBtn">
|
|
|
<avue-crud ref="crud" :option="option2" :data="data" :table-loading="loading" @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn" :cell-style="cellStyle" class="address">
|
|
|
- <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="menu" slot-scope="{ row, index }">
|
|
|
- <el-button size="small" type="text" @click="rowCell(row, index)">{{
|
|
|
- row.$cellEdit ? "保存" : "修改"
|
|
|
- }}</el-button>
|
|
|
- <el-button size="small" type="text" @click="rowDel(row, index)">删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
+ @resetColumn="resetColumn" :cell-style="cellStyle" class="address">
|
|
|
+ <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="menu" slot-scope="{ row, index }">
|
|
|
+ <el-button size="small" type="text" @click="rowCell(row, index)">{{
|
|
|
+ row.$cellEdit ? "保存" : "修改"
|
|
|
+ }}</el-button>
|
|
|
+ <el-button size="small" type="text" @click="rowDel(row, index)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
<!-- <el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="客户地址" name="first">
|
|
|
<avue-crud ref="crud" :option="option2" :data="data1" :table-loading="loading" @saveColumn="saveColumn"
|
|
@@ -81,11 +81,12 @@
|
|
|
<c-upload v-loading="loadingBtn" typeUpload="CD"
|
|
|
deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
|
|
|
:enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
|
|
|
- <el-dialog title="添加客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
|
|
|
- width="30%" append-to-body @closed="corpTypeClosed">
|
|
|
+ <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
|
|
|
+ append-to-body @closed="corpTypeClosed">
|
|
|
<span>
|
|
|
- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
|
|
|
- </avue-form>
|
|
|
+ <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>
|
|
@@ -98,7 +99,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { option2, option3 } from "./js/optionList";
|
|
|
-import { getDetails, addCorpType, getCorpType, submit, customerList } from "@/api/basicData/client";
|
|
|
+import { getDetails, addCorpType, getCorpType, submit, customerList, itemDel } from "@/api/basicData/client";
|
|
|
+import corpType from '@/components/corpType/index'
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
@@ -117,7 +119,7 @@ export default {
|
|
|
form2: {},
|
|
|
form3: {},
|
|
|
form4: {},
|
|
|
- data:[],
|
|
|
+ data: [],
|
|
|
data1: [],
|
|
|
data2: [],
|
|
|
option: {
|
|
@@ -206,9 +208,12 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- corpsFiles:[]
|
|
|
+ corpsFiles: []
|
|
|
};
|
|
|
},
|
|
|
+ components: {
|
|
|
+ corpType
|
|
|
+ },
|
|
|
props: {
|
|
|
detailData: {
|
|
|
type: Object
|
|
@@ -217,9 +222,9 @@ export default {
|
|
|
async created() {
|
|
|
this.option2 = await this.getColumnData(this.getColumnName(208), option2);
|
|
|
// this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
|
|
|
- // if (this.detailData.id) {
|
|
|
- // this.getDetail(this.detailData.id);
|
|
|
- // }
|
|
|
+ if (this.detailData.id) {
|
|
|
+ this.getDetail(this.detailData.id);
|
|
|
+ }
|
|
|
if (this.detailData.status == 1) {
|
|
|
this.option.disabled = true;
|
|
|
}
|
|
@@ -231,10 +236,11 @@ export default {
|
|
|
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.$refs.crud.init();
|
|
|
+ this.getWorkDicts("abbreviation").then(res => {
|
|
|
+ this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ this.findObject(this.option2.column, "addr").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
|
|
|
+ this.$refs.crud.init();
|
|
|
},
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
@@ -251,8 +257,8 @@ export default {
|
|
|
getDetails({ id: id })
|
|
|
.then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.data= res.data.data.corpsAddrList
|
|
|
- this.corpsFiles=res.data.data.corpsFiles
|
|
|
+ this.data = res.data.data.corpsAddrList
|
|
|
+ this.corpsFiles = res.data.data.corpsFiles
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loadingBtn = false;
|
|
@@ -262,7 +268,7 @@ export default {
|
|
|
this.form.corpName = row.cname
|
|
|
},
|
|
|
addRow() {
|
|
|
- this.data.push({ $cellEdit: true})
|
|
|
+ this.data.push({ $cellEdit: true })
|
|
|
},
|
|
|
rowCell(row, index) {
|
|
|
if (row.$cellEdit == true) {
|
|
@@ -278,13 +284,13 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- // itemDel(row.id).then(res => {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: "删除成功!"
|
|
|
- // });
|
|
|
- // this.data1.splice(index, 1);
|
|
|
- // });
|
|
|
+ itemDel(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.data.splice(index, 1);
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
@@ -328,8 +334,8 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
corpTypeClosed() {
|
|
|
- this.reload = Math.random();
|
|
|
- this.form4 = this.$options.data().form4
|
|
|
+ // this.reload = Math.random();
|
|
|
+ // this.form4 = this.$options.data().form4
|
|
|
},
|
|
|
getCorpType() {
|
|
|
getCorpType({ corpType: 'KH' }).then(res => {
|
|
@@ -337,19 +343,21 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
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.$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() {
|
|
@@ -357,12 +365,12 @@ export default {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
this.loadingBtn = true;
|
|
|
- submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data})
|
|
|
+ submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data })
|
|
|
.then(res => {
|
|
|
this.$message.success("保存成功");
|
|
|
this.form = res.data.data;
|
|
|
this.data = res.data.data.corpsAddrList
|
|
|
- this.corpsFiles=res.data.data.corpsFiles
|
|
|
+ this.corpsFiles = res.data.data.corpsFiles
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loadingBtn = false;
|