|
@@ -59,7 +59,11 @@
|
|
|
</table>
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
- <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" />
|
|
|
+ <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" @save="corpTypeVisible = true">
|
|
|
+ <template slot="addBtn">
|
|
|
+ <i class="el-icon-plus" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;" @click="corpTypeVisible = true"></i>
|
|
|
+ </template>
|
|
|
+ </avue-tree>
|
|
|
</el-col>
|
|
|
<el-col :span="20">
|
|
|
<avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
|
|
@@ -113,6 +117,17 @@
|
|
|
</basic-container>
|
|
|
<details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
|
|
|
<details-info v-if="!showInfo" @goBack="goBack()" :detailData="detailData" />
|
|
|
+ <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="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>
|
|
|
|
|
@@ -120,11 +135,12 @@
|
|
|
import detailsInfo from "./detailsInfo";
|
|
|
import detailsPage from "./detailsPage";
|
|
|
import { option } from "./js/optionList";
|
|
|
-import { getList, getCorpType, pageStatistics, remove } from "@/api/basicData/client";
|
|
|
+import { getList, getCorpType, pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/client";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
+ corpTypeVisible: false,
|
|
|
src: '',
|
|
|
show: true,
|
|
|
showInfo: true,
|
|
@@ -178,8 +194,8 @@ export default {
|
|
|
text: '当季',
|
|
|
onClick(picker) {
|
|
|
const date = new Date();
|
|
|
- const start = new Date(date.getFullYear(),parseInt(date.getMonth()/3)*3, 1, 0, 0, 0);
|
|
|
- const end = new Date(date.getFullYear(),parseInt(date.getMonth()/3)*3+3, 0, 23, 59, 59);
|
|
|
+ const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
|
|
|
+ const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
|
}, {
|
|
@@ -202,7 +218,7 @@ export default {
|
|
|
text: '最近二周',
|
|
|
onClick(picker) {
|
|
|
const date = new Date();
|
|
|
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7*2, 0, 0, 0);
|
|
|
+ const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
|
|
|
const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
@@ -210,7 +226,7 @@ export default {
|
|
|
text: '最近三周',
|
|
|
onClick(picker) {
|
|
|
const date = new Date();
|
|
|
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7*3, 0, 0, 0);
|
|
|
+ const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
|
|
|
const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
@@ -226,7 +242,37 @@ export default {
|
|
|
value: "value",
|
|
|
}
|
|
|
},
|
|
|
- treeData: []
|
|
|
+ treeData: [],
|
|
|
+ form4: {},
|
|
|
+ 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,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -256,6 +302,9 @@ export default {
|
|
|
getCorpType({ corpType: 'KH' }).then(res => {
|
|
|
this.treeData = res.data.data
|
|
|
});
|
|
|
+ customerList({ corpType: "KH" }).then(res => {
|
|
|
+ this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
|
|
|
+ });
|
|
|
this.$refs.crud.init();
|
|
|
},
|
|
|
searchCriteriaSwitch(type) {
|
|
@@ -306,6 +355,25 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ addCorpType() {
|
|
|
+ this.$refs["corpType"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ this.corpTypeVisible = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ corpTypeClosed() {
|
|
|
+ this.reload = Math.random();
|
|
|
+ this.form4 = this.$options.data().form4
|
|
|
+ },
|
|
|
viewInfo(row) {
|
|
|
this.detailData = {
|
|
|
id: row.id,
|
|
@@ -386,6 +454,16 @@ export default {
|
|
|
height: 94.2vh;
|
|
|
}
|
|
|
|
|
|
+::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+::v-deep .el-input-group__append{
|
|
|
+ padding: 0 0px !important;
|
|
|
+}
|
|
|
+.el-dialog ::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+
|
|
|
.stat-td {
|
|
|
text-align: center;
|
|
|
position: relative;
|