|
|
@@ -17,9 +17,9 @@
|
|
|
<avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
<template slot="corpsTypeId">
|
|
|
<div style="display:flex;">
|
|
|
- <avue-select v-model="form.corpsTypeId" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
|
|
|
- </avue-select>
|
|
|
- <!-- <el-button icon="el-icon-plus" size="mini" @click="corpTypeVisible = true"></el-button> -->
|
|
|
+ <avue-cascader :emit-path="false" check-strictly :show-all-levels="false" v-model="form.corpsTypeId"
|
|
|
+ placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
|
|
|
+ </avue-cascader>
|
|
|
<i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
|
|
|
@click="corpTypeVisible = true"></i>
|
|
|
</div>
|
|
|
@@ -27,48 +27,50 @@
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="地址管理" v-loading="loadingBtn">
|
|
|
- <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn" :cell-style="cellStyle" @row-save="rowSave" @row-update="addUpdate">
|
|
|
- <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"
|
|
|
+ @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-tab-pane>
|
|
|
+ <el-tab-pane label="物流地址" name="second">
|
|
|
+ <avue-crud ref="crud2" :option="option3" :data="data2" :table-loading="loading" @saveColumn="saveColumn2"
|
|
|
+ @resetColumn="resetColumn2" :cell-style="cellStyle">
|
|
|
+ <template slot="headerSerial">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow2"
|
|
|
+ :disabled="detailData.status == 1" circle></el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="menu" slot-scope="{ row, index }">
|
|
|
+ <el-button size="small" type="text" @click="rowCell2(row, index)">{{
|
|
|
+ row.$cellEdit ? "保存" : "修改"
|
|
|
+ }}</el-button>
|
|
|
+ <el-button size="small" type="text" @click="rowDel2(row, index)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
</trade-card>
|
|
|
<containerTitle title="上传附件"></containerTitle>
|
|
|
<c-upload v-loading="loadingBtn" typeUpload="CD"
|
|
|
deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
|
|
|
:enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
|
|
|
- <el-dialog :title="addressTitle" v-dialogDrag :visible.sync="addressVisible" class="avue-dialog avue-dialog--top"
|
|
|
- width="50%" append-to-body @closed="addressClosed">
|
|
|
- <span>
|
|
|
- <el-tabs v-model="activeName">
|
|
|
- <el-tab-pane label="客户地址" name="first">
|
|
|
- <avue-form :key="reload1" ref="address1" class="trading-form" v-model="form2" :option="option2">
|
|
|
- </avue-form>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="物流地址" name="second">
|
|
|
- <avue-form :key="reload2" ref="address2" class="trading-form" v-model="form3" :option="option3">
|
|
|
- </avue-form>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </span>
|
|
|
- <div class="avue-dialog__footer">
|
|
|
- <el-button @click="addressVisible = false">取 消</el-button>
|
|
|
- <el-button @click="importAddRess(activeName)" type="primary">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
<el-dialog title="添加客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
|
|
|
width="30%" append-to-body @closed="corpTypeClosed">
|
|
|
<span>
|
|
|
- <avue-form :key="reload3" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
|
|
|
+ <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
|
|
|
</avue-form>
|
|
|
</span>
|
|
|
<div class="avue-dialog__footer">
|
|
|
@@ -81,8 +83,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { optionList } from "./js/optionList";
|
|
|
-import { getDetails, addCorpType, getCorpType, submit } from "@/api/basicData/client";
|
|
|
+import { option2, option3 } from "./js/optionList";
|
|
|
+import { getDetails, addCorpType, getCorpType, submit, customerList } from "@/api/basicData/client";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
@@ -101,7 +103,8 @@ export default {
|
|
|
form2: {},
|
|
|
form3: {},
|
|
|
form4: {},
|
|
|
- data: [],
|
|
|
+ data1: [],
|
|
|
+ data2: [],
|
|
|
option: {
|
|
|
menuBtn: false,
|
|
|
labelWidth: 130,
|
|
|
@@ -157,38 +160,15 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- option2: {
|
|
|
+ option2: {},
|
|
|
+ option3: {},
|
|
|
+ option4: {
|
|
|
menuBtn: false,
|
|
|
- labelWidth: 90,
|
|
|
+ labelWidth: 80,
|
|
|
column: [
|
|
|
{
|
|
|
- label: "简称",
|
|
|
- allowCreate: true,
|
|
|
- filterable: true,
|
|
|
- prop: "abbreviation",
|
|
|
- type: "select",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictKey"
|
|
|
- },
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=abbreviation",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "地址",
|
|
|
- prop: "addr",
|
|
|
- dicData: JSON.parse(localStorage.getItem('areaTypeTree')),
|
|
|
- dataType: "string",
|
|
|
- type: "cascader",
|
|
|
- props: {
|
|
|
- label: 'name',
|
|
|
- value: 'name'
|
|
|
- },
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "详细地址",
|
|
|
- prop: "detailedAddress",
|
|
|
+ label: "分类名称",
|
|
|
+ prop: "cname",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -199,110 +179,18 @@ export default {
|
|
|
span: 24,
|
|
|
},
|
|
|
{
|
|
|
- label: "邮编",
|
|
|
- prop: "postalCode",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remarks",
|
|
|
- type: 'textarea',
|
|
|
- minRows: 3,
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "地址智能识别",
|
|
|
- prop: "ad",
|
|
|
- placeholder: "例:上海市徐汇区枫林街道斜土路100号",
|
|
|
- type: "textarea",
|
|
|
- minRows: 3,
|
|
|
- span: 24,
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- option3: {
|
|
|
- menuBtn: false,
|
|
|
- labelWidth: 90,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "目的地",
|
|
|
- prop: "destination",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "物流公司",
|
|
|
- prop: "logisticsCompany",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "电话",
|
|
|
- prop: "tel",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "地址",
|
|
|
- prop: "addr",
|
|
|
- dicData: JSON.parse(localStorage.getItem('areaTypeTree')),
|
|
|
- dataType: "string",
|
|
|
- type: "cascader",
|
|
|
+ label: "上级类型",
|
|
|
+ prop: "parentId",
|
|
|
+ dicData: [],
|
|
|
+ type: "tree",
|
|
|
props: {
|
|
|
- label: 'name',
|
|
|
- value: 'name'
|
|
|
+ label: "cname",
|
|
|
+ value: "id"
|
|
|
},
|
|
|
span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "详细地址",
|
|
|
- prop: "detailedAddress",
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ],
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "邮编",
|
|
|
- prop: "postalCode",
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remarks",
|
|
|
- type: "textarea",
|
|
|
- minRows: 3,
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "地址智能识别",
|
|
|
- prop: "g",
|
|
|
- type: "textarea",
|
|
|
- minRows: 3,
|
|
|
- span: 24,
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- option4: {
|
|
|
- menuBtn: false,
|
|
|
- labelWidth: 80,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "分类名称",
|
|
|
- prop: "cname",
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ],
|
|
|
- span: 24,
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- optionList: {},
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -311,9 +199,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
- this.optionList = await this.getColumnData(
|
|
|
+ this.option2 = await this.getColumnData(
|
|
|
this.getColumnName(208),
|
|
|
- optionList
|
|
|
+ option2
|
|
|
+ );
|
|
|
+ this.option3 = await this.getColumnData(
|
|
|
+ this.getColumnName(208.4),
|
|
|
+ option3
|
|
|
);
|
|
|
if (this.detailData.id) {
|
|
|
this.getDetail(this.detailData.id);
|
|
|
@@ -322,17 +214,21 @@ export default {
|
|
|
this.option.disabled = true;
|
|
|
}
|
|
|
this.getCorpType()
|
|
|
+ this.getAllWorkDicts()
|
|
|
},
|
|
|
methods: {
|
|
|
getAllWorkDicts() {
|
|
|
- this.findObject(this.option2.column, "addr").dicData = JSON.parse(localStorage.getItem('areaTypeTree'));
|
|
|
- this.findObject(this.option3.column, "addr").dicData = JSON.parse(localStorage.getItem('areaTypeTree'));
|
|
|
+ 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;
|
|
|
+ });
|
|
|
},
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
selectValue(value, row) {
|
|
|
- console.log(value, row)
|
|
|
if (row.feesId) {
|
|
|
row.feesName = value.cname
|
|
|
} else {
|
|
|
@@ -354,27 +250,15 @@ export default {
|
|
|
this.form.corpName = row.cname
|
|
|
},
|
|
|
addRow() {
|
|
|
- this.addressTitle = '新增地址'
|
|
|
- this.addressVisible = true
|
|
|
+ this.data1.push({ $cellEdit: true, type: 0 })
|
|
|
},
|
|
|
rowCell(row, index) {
|
|
|
- // this.$refs.crud.rowCell(row, index)
|
|
|
- this.addressTitle = '修改地址'
|
|
|
- this.addressVisible = true
|
|
|
- if (row.type == 0) {
|
|
|
- this.activeName = "first"
|
|
|
- this.form2=row
|
|
|
- }else{
|
|
|
- this.activeName = "second"
|
|
|
- this.form3=row
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
}
|
|
|
},
|
|
|
- rowSave(form, done) {
|
|
|
- done()
|
|
|
- },
|
|
|
- addUpdate(form, index, done, loading) {
|
|
|
- done()
|
|
|
- },
|
|
|
rowDel(row, index) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -387,58 +271,54 @@ export default {
|
|
|
// type: "success",
|
|
|
// message: "删除成功!"
|
|
|
// });
|
|
|
- // this.data.splice(index, 1);
|
|
|
+ // this.data1.splice(index, 1);
|
|
|
// });
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "删除成功!"
|
|
|
});
|
|
|
- this.data.splice(index, 1);
|
|
|
+ this.data1.splice(index, 1);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- addressClosed() {
|
|
|
- this.reload1 = Math.random();
|
|
|
- this.reload2 = Math.random();
|
|
|
- this.form2 = this.$options.data().form2
|
|
|
- this.form3 = this.$options.data().form3
|
|
|
- },
|
|
|
- corpTypeClosed() {
|
|
|
- this.reload3 = Math.random();
|
|
|
- this.form4 = this.$options.data().form4
|
|
|
+ addRow2() {
|
|
|
+ this.data2.push({ $cellEdit: true, type: 1 })
|
|
|
},
|
|
|
- importAddRess(status) {
|
|
|
- if (status == 'first') {
|
|
|
- this.$refs["address1"].validate((valid, done) => {
|
|
|
- done();
|
|
|
- if (valid) {
|
|
|
- if(this.addressTitle=='新增地址'){
|
|
|
- this.data.push({ ...this.form2, type: 0 })
|
|
|
- }else{
|
|
|
- this.$set(this.data,this.form2.$index,{ ...this.form2, type: 0 })
|
|
|
- }
|
|
|
- this.addressVisible = false
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ rowCell2(row, index) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
} else {
|
|
|
- this.$refs["address2"].validate((valid, done) => {
|
|
|
- done();
|
|
|
- if (valid) {
|
|
|
- if(this.addressTitle=='新增地址'){
|
|
|
- this.data.push({ ...this.form3, type: 1 })
|
|
|
- }else{
|
|
|
- this.$set(this.data,this.form3.$index,{ ...this.form3, type: 1 })
|
|
|
- }
|
|
|
- this.addressVisible = false
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ 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
|
|
|
@@ -482,7 +362,7 @@ export default {
|
|
|
async saveColumn() {
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(208),
|
|
|
- this.optionList
|
|
|
+ this.option2
|
|
|
);
|
|
|
if (inSave) {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -494,10 +374,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async resetColumn() {
|
|
|
- this.optionList = optionList;
|
|
|
+ this.option2 = option2;
|
|
|
const inSave = await this.delColumnData(
|
|
|
this.getColumnName(208),
|
|
|
- optionList
|
|
|
+ option2
|
|
|
);
|
|
|
if (inSave) {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -508,6 +388,35 @@ export default {
|
|
|
this.$refs.crud.$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");
|
|
|
@@ -530,6 +439,10 @@ export default {
|
|
|
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;
|