|
@@ -76,6 +76,22 @@
|
|
|
</el-tabs> -->
|
|
|
|
|
|
</trade-card>
|
|
|
+ <trade-card title="客户联系人">
|
|
|
+ <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 }" slot="menu">
|
|
|
+ <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </trade-card>
|
|
|
<containerTitle title="上传附件"></containerTitle>
|
|
|
<c-upload v-loading="loadingBtn" typeUpload="CD"
|
|
|
deleteUrl="/api/blade-client/corpsfiles/remove" :data="corpsFiles" display
|
|
@@ -93,6 +109,15 @@
|
|
|
</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>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -100,6 +125,12 @@
|
|
|
import { option2, option3 } from "./js/optionList";
|
|
|
import { getDetails, addCorpType, getCorpType, submit, customerList, itemDel } from "@/api/basicData/client";
|
|
|
import corpType from '@/components/corpType/index'
|
|
|
+import customerContact from "@/views/basicData/customerInformation/configuration/customerContact.json";
|
|
|
+import {corpsattn, creatingUsers} 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";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
@@ -108,6 +139,73 @@ export default {
|
|
|
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"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ dialogVisibleBt:false,
|
|
|
+ formDataTwo:false,
|
|
|
+ customerContact: {},
|
|
|
+ contactsForm: {},
|
|
|
+ contactsData:[],
|
|
|
corpTypeList: [],
|
|
|
corpTypeVisible: false,
|
|
|
activeName: 'first',
|
|
@@ -231,6 +329,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
+ this.customerContact = await this.getColumnData(
|
|
|
+ this.getColumnName(143),
|
|
|
+ customerContact
|
|
|
+ );
|
|
|
this.option2 = await this.getColumnData(this.getColumnName(208), option2);
|
|
|
// this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
|
|
|
if (this.detailData.id) {
|
|
@@ -239,10 +341,53 @@ export default {
|
|
|
if (this.detailData.status == 1) {
|
|
|
this.option.disabled = true;
|
|
|
}
|
|
|
+ if (!website.tenantMode) {
|
|
|
+ this.initData(website.tenantId);
|
|
|
+ } else {
|
|
|
+ this.initData();
|
|
|
+ }
|
|
|
this.getCorpType()
|
|
|
this.getAllWorkDicts()
|
|
|
},
|
|
|
methods: {
|
|
|
+ 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(",");
|
|
|
+ creatingUsers({
|
|
|
+ ...data,
|
|
|
+ id: this.formRow.id
|
|
|
+ }).then(res => {
|
|
|
+ this.dialogVisibleBt = false;
|
|
|
+ this.formDataTwo = {}
|
|
|
+ this.$message.success(
|
|
|
+ "创建用户成功,默认帐号:手机号。默认密码:123456"
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getAllWorkDicts() {
|
|
|
customerList({ corpType: "KH" }).then(res => {
|
|
|
this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
|
|
@@ -270,6 +415,7 @@ export default {
|
|
|
this.form = res.data.data;
|
|
|
this.data = res.data.data.corpsAddrList
|
|
|
this.corpsFiles = res.data.data.corpsFiles
|
|
|
+ this.contactsData = res.data.data.corpsAttnList
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loadingBtn = false;
|
|
@@ -387,6 +533,7 @@ export default {
|
|
|
corpType: "KH",
|
|
|
corpsAddrList: this.data,
|
|
|
corpsFiles: this.corpsFiles,
|
|
|
+ corpsAttnList:this.contactsData,
|
|
|
billType:1
|
|
|
}).then(res => {
|
|
|
this.$message.success("保存成功");
|
|
@@ -431,6 +578,84 @@ export default {
|
|
|
this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ creatingUsers(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) {
|
|
|
+ console.log(row, done, loading);
|
|
|
+ this.contactsData.push(row);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ //修改客户联系人触发
|
|
|
+ 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(143),
|
|
|
+ this.customerContact
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crudTwo.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetColumnTwo() {
|
|
|
+ this.customerContact = customerContact;
|
|
|
+ const inSave = await this.delColumnData(
|
|
|
+ this.getColumnName(143),
|
|
|
+ customerContact
|
|
|
+ );
|
|
|
+ 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),
|