From 7045ca2f6b6bcbc3987e388bf0b25281c250ccf5 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 19 四月 2024 18:09:00 +0800
Subject: [PATCH] srm 新增编辑供应商,启用停用创建账号获取和保存企业/信用等级/供货范围 ,等大概7个接口的联调
---
src/components/makepager/TableCommonView.vue | 3
src/views/supplierManage/outsourceSupplier/components/CreateAccount.vue | 199 ++++++++++++++++++++++
vue.config.js | 9
src/views/supplierManage/outsourceSupplier/index.vue | 50 ++++-
src/api/supplierManage/outsourceSupplier.js | 4
src/views/supplierManage/outsourceSupplier/components/addEnterprise.vue | 272 ++++++++++++++++++++----------
6 files changed, 431 insertions(+), 106 deletions(-)
diff --git a/src/api/supplierManage/outsourceSupplier.js b/src/api/supplierManage/outsourceSupplier.js
index 3dcec63..2357eba 100644
--- a/src/api/supplierManage/outsourceSupplier.js
+++ b/src/api/supplierManage/outsourceSupplier.js
@@ -38,7 +38,7 @@
// 娣诲姞澶栭儴鐢ㄦ埛璐﹀彿
export const addOutsideUser = (data) => {
return request({
- url: "/api-srm/outsideUser/addUser",
+ url: "/api/outsideUser/addUser",
method: "post",
data
})
@@ -47,7 +47,7 @@
// 鍚敤/绂佺敤澶栭儴鐢ㄦ埛
export const editOutsideUser = (data) => {
return request({
- url: "/api-srm/outsideUser/editUser",
+ url: "/api/outsideUser/editUser",
method: "post",
data
})
diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 46faad2..698f5fd 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -463,6 +463,9 @@
font-weight: bold;
}
}
+ .el-table__fixed-body-wrapper {
+ top:37px!important;
+ }
}
::v-deep .el-table .cell {
diff --git a/src/views/supplierManage/outsourceSupplier/components/CreateAccount.vue b/src/views/supplierManage/outsourceSupplier/components/CreateAccount.vue
new file mode 100644
index 0000000..3db1857
--- /dev/null
+++ b/src/views/supplierManage/outsourceSupplier/components/CreateAccount.vue
@@ -0,0 +1,199 @@
+<template>
+ <el-dialog
+ :close-on-click-modal="false"
+ :visible.sync="islook"
+ width="35rem"
+ class="add-event-dialog"
+ @close="shutdown"
+ >
+ <div slot="title" class="tac drawerHeader">
+ <span>{{ "鍒涘缓璐﹀彿" }}</span>
+ </div>
+ <div class="dialog-content-box">
+ <el-form
+ ref="form"
+ :rules="rules"
+ :model="form"
+ label-width="100px"
+ label-position="left"
+ >
+ <el-form-item label="鐢ㄦ埛鍚�" prop="tel">
+ <span v-if="editRow.look == 'look'">{{ form.tel }}</span>
+ <el-input
+ v-else
+ v-model="form.tel"
+ clearable
+ placeholder="璇疯緭鍏ユ墜鏈哄彿浣滀负鐢ㄦ埛鍚�"
+ :disabled="titleName == '缂栬緫' ? true : false"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鐧诲綍瀵嗙爜" prop="password">
+ <span v-if="editRow.look == 'look'">{{ form.password }}</span>
+ <div v-else class="login-password-box">
+ <el-input
+ v-model="form.password"
+ placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�"
+ :auto-complete="'new-password'"
+ type="password"
+ :disabled="titleName == '缂栬緫' ? true : false"
+ show-password
+ ></el-input>
+ <el-button
+ v-if="titleName !== '缂栬緫'"
+ type="text"
+ style="margin-left: 5px"
+ @click="generateRandomNumber"
+ >鐢熸垚闅忔満瀵嗙爜</el-button
+ >
+ </div>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div slot="footer" class="dialog-footer tac">
+ <el-button @click="shutdown">鍙栨秷</el-button>
+ <el-button type="primary" @click="onSubmit(form)">纭畾</el-button>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import {
+ addOutsideUser,
+ updateEnterprise,
+} from "@/api/supplierManage/outsourceSupplier"
+export default {
+ components: {},
+ props: {
+ titleName: {
+ type: String,
+ default: "鏂板",
+ },
+ editRow: {
+ type: [Object],
+ default: () => {
+ return {};
+ },
+ },
+ showList: {
+ type: [Array],
+ },
+ },
+ data() {
+ return {
+ islook: false,
+ form: {
+ tel: "",
+ password: "123456",
+ },
+ rules: {
+ tel: [
+ { required: true, message: "璇峰~鍐欒仈绯绘柟寮�", trigger: "blur" }, // 鑱旂郴鏂瑰紡
+ ],
+ password: [
+ { required: true, message: "璇峰~鍐欑櫥褰曞瘑鐮�", trigger: "blur" }, // 鐧诲綍瀵嗙爜
+ ],
+ },
+ editParams: {},
+ };
+ },
+ mounted() {
+ // this.handleGetList(5);
+ // this.handleGetList(6);
+ // this.handleGetList(7);
+ },
+ watch: {
+ editRow(val) {
+ if (val.id && this.islook) {
+ this.initFormData(val);
+ } else {
+ this.$nextTick(() => {
+ this.$refs.form.resetFields();
+ });
+ }
+ },
+ islook(val) {
+ if (val) {
+ this.form = {
+ tel: "",
+ password: "123456",
+ };
+ }
+ },
+ },
+ methods: {
+ initFormData(row) {
+ if (row.id) {
+ this.editParams = JSON.parse(JSON.stringify(row));
+ // if (this.form.takerId && this.form.takerName) {
+ // this.form.takerObj = this.form.takerId + "&" + this.form.takerName;
+ // }
+ }
+ },
+ onSubmit() {
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ this.addOutsideUser(this.editRow);
+ }
+ });
+ },
+ // 娣诲姞澶栭儴鐢ㄦ埛
+ addOutsideUser(data) {
+ addOutsideUser({
+ companyId: data.id,
+ companyName: data.name,
+ companyNumber: data.number,
+ passWord: this.form.password,
+ userName: this.form.tel,
+ }).then((res) => {
+ console.log(res);
+ if (res.code == 200) {
+ this.updateEnterprise();
+ this.$message.success("鍒涘缓璐﹀彿鎴愬姛锛�");
+ this.shutdown();
+ }
+ });
+ },
+ updateEnterprise() {
+ this.editParams.tel = this.form.tel;
+ updateEnterprise(this.editParams).then((res) => {
+ if (res.code == 200) {
+ this.$emit("shutdown");
+ }
+ });
+ },
+ shutdown() {
+ this.$refs.form.resetFields();
+ this.islook = false;
+ },
+ // 闅忔満鐢熸垚鍏綅鏁板瘑鐮�
+ generateRandomNumber() {
+ let passwordStr = Math.floor(100000 + Math.random() * 900000);
+ console.log(passwordStr);
+ this.$set(this.form, "password", passwordStr+'');
+ },
+ },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog-content-box {
+ padding: 0px 30px;
+ // overflow-y: auto;
+ // .el-form {
+ // overflow: hidden;
+ // }
+ .login-password-box {
+ display: flex;
+ }
+}
+
+::v-deep {
+ .el-tabs__content {
+ height: calc(100% - 55px);
+ overflow-y: auto;
+ }
+ .el-dialog__body{
+ padding-top:15px;
+ }
+}
+</style>
diff --git a/src/views/supplierManage/outsourceSupplier/components/addEnterprise.vue b/src/views/supplierManage/outsourceSupplier/components/addEnterprise.vue
index 2840394..2195a24 100644
--- a/src/views/supplierManage/outsourceSupplier/components/addEnterprise.vue
+++ b/src/views/supplierManage/outsourceSupplier/components/addEnterprise.vue
@@ -2,7 +2,7 @@
<el-dialog
:close-on-click-modal="false"
:visible.sync="islook"
- width="35rem"
+ width="38rem"
class="add-event-dialog"
@close="shutdown"
>
@@ -10,19 +10,46 @@
<span>{{ titleName }}浼佷笟</span>
</div>
<div class="dialog-content-box">
- <el-form ref="form" :rules="rules" :model="form" label-width="100px" label-position="left">
+ <div class="basic-info-title">鍩烘湰淇℃伅</div>
+ <el-form
+ ref="form"
+ :rules="rules"
+ :model="form"
+ label-width="100px"
+ label-position="left"
+ >
<el-form-item label="浼佷笟缂栫爜" prop="number">
<span v-if="editRow.look == 'look'">{{ form.number }}</span>
- <el-input v-else v-model="form.number" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.number"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
<el-form-item label="浼佷笟鍚嶇О" prop="name">
<span v-if="editRow.look == 'look'">{{ form.name }}</span>
- <el-input v-else v-model="form.name" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.name"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
<el-form-item label="浼佷笟绫诲瀷" prop="enterpriseType">
<span v-if="editRow.look == 'look'">{{ form.enterpriseType }}</span>
- <el-select v-model="form.enterpriseType" placeholder="浼佷笟绫诲瀷" filterable style="width: calc(100% - 30px)">
- <el-option v-for="ele in enterpriseTypeList" :key="ele.id" :label="ele.name" :value="ele.name"></el-option>
+ <el-select
+ v-model="form.enterpriseType"
+ placeholder="浼佷笟绫诲瀷"
+ filterable
+ style="width: calc(100% - 30px)"
+ >
+ <el-option
+ v-for="ele in enterpriseTypeList"
+ :key="ele.id"
+ :label="ele.name"
+ :value="ele.name"
+ ></el-option>
</el-select>
<i
class="el-icon-setting margin_left_10px cursor_pointer"
@@ -32,9 +59,14 @@
</el-form-item>
<el-form-item label="鑱旂郴浜�" prop="contact">
<span v-if="editRow.look == 'look'">{{ form.contact }}</span>
- <el-input v-else v-model="form.contact" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.contact"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
- <el-form-item label="鑱旂郴鏂瑰紡" prop="tel">
+ <el-form-item v-if="titleName == '缂栬緫'" label="鑱旂郴鏂瑰紡" prop="tel">
<span v-if="editRow.look == 'look'">{{ form.tel }}</span>
<el-input
v-else
@@ -44,7 +76,11 @@
:disabled="titleName == '缂栬緫' ? true : false"
></el-input>
</el-form-item>
- <el-form-item label="鐧诲綍瀵嗙爜" prop="password">
+ <el-form-item
+ v-if="titleName == '缂栬緫'"
+ label="鐧诲綍瀵嗙爜"
+ prop="password"
+ >
<span v-if="editRow.look == 'look'">{{ form.password }}</span>
<div v-else class="login-password-box">
<el-input
@@ -55,7 +91,11 @@
:disabled="titleName == '缂栬緫' ? true : false"
show-password
></el-input>
- <el-button v-if="titleName !== '缂栬緫'" type="text" style="margin-left: 5px" @click="generateRandomNumber"
+ <el-button
+ v-if="titleName !== '缂栬緫'"
+ type="text"
+ style="margin-left: 5px"
+ @click="generateRandomNumber"
>鐢熸垚闅忔満瀵嗙爜</el-button
>
</div>
@@ -70,7 +110,12 @@
filterable
style="width: calc(100% - 30px)"
>
- <el-option v-for="item in creditGradeList" :key="item.id" :label="item.name" :value="item.name">
+ <el-option
+ v-for="item in creditGradeList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.name"
+ >
</el-option>
</el-select>
<i
@@ -81,15 +126,30 @@
</el-form-item>
<el-form-item label="璇︾粏鍦板潃" prop="address">
<span v-if="editRow.look == 'look'">{{ form.address }}</span>
- <el-input v-else v-model="form.address" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.address"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
<el-form-item label="渚涜揣鑳藉姏" prop="supplyCapacity">
<span v-if="editRow.look == 'look'">{{ form.supplyCapacity }}</span>
- <el-input v-else v-model="form.supplyCapacity" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.supplyCapacity"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
<el-form-item label="缁勭粐鏈烘瀯浠g爜" prop="organizationCode">
<span v-if="editRow.look == 'look'">{{ form.organizationCode }}</span>
- <el-input v-else v-model="form.organizationCode" clearable placeholder="璇疯緭鍏�"></el-input>
+ <el-input
+ v-else
+ v-model="form.organizationCode"
+ clearable
+ placeholder="璇疯緭鍏�"
+ ></el-input>
</el-form-item>
<el-form-item label="渚涜揣鑼冨洿" prop="supplyRange">
<span v-if="editRow.look == 'look'">{{ form.supplyRange }}</span>
@@ -101,7 +161,12 @@
filterable
style="width: calc(100% - 30px)"
>
- <el-option v-for="item in supplyRangeList" :key="item.id" :label="item.name" :value="item.name">
+ <el-option
+ v-for="item in supplyRangeList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.name"
+ >
</el-option>
</el-select>
<i
@@ -128,27 +193,31 @@
</template>
<script>
-import { addEnterprise, updateEnterprise, addOutsideUser } from "@/api/supplierManage/outsourceSupplier"
-import { getMiniDictList, saveMiniDict } from "@/api/common/other" // 璐ㄦ鏂瑰紡
-import VersionType from "@/views/supplierManage/outsourceSupplier/components/VersionType"
+import {
+ addEnterprise,
+ updateEnterprise,
+ addOutsideUser,
+} from "@/api/supplierManage/outsourceSupplier"
+import { getMiniDictList, saveMiniDict } from "@/api/common/other"; // 璐ㄦ鏂瑰紡
+import VersionType from "@/views/supplierManage/outsourceSupplier/components/VersionType";
export default {
components: {
- VersionType
+ VersionType,
},
props: {
titleName: {
type: String,
- default: "鏂板"
+ default: "鏂板",
},
editRow: {
type: [Object],
default: () => {
- return {}
- }
+ return {};
+ },
},
showList: {
- type: [Array]
- }
+ type: [Array],
+ },
},
data() {
return {
@@ -165,50 +234,51 @@
organizationCode: "",
supplyRange: "",
status: 0,
- password: "123456"
+ password: "123456",
},
rules: {
number: [
- { required: true, message: "璇峰~鍐欎紒涓氱紪鐮�", trigger: "blur" } // 浼佷笟缂栫爜
+ { required: true, message: "璇峰~鍐欎紒涓氱紪鐮�", trigger: "blur" }, // 浼佷笟缂栫爜
],
name: [
- { required: true, message: "璇峰~鍐欎紒涓氬悕绉�", trigger: "blur" } // 浼佷笟鍚嶇О
+ { required: true, message: "璇峰~鍐欎紒涓氬悕绉�", trigger: "blur" }, // 浼佷笟鍚嶇О
],
enterpriseType: [
- { required: true, message: "璇烽�夋嫨浼佷笟绫诲瀷", trigger: "change" } // 浼佷笟绫诲瀷
+ { required: true, message: "璇烽�夋嫨浼佷笟绫诲瀷", trigger: "change" }, // 浼佷笟绫诲瀷
],
tel: [
- { required: true, message: "璇峰~鍐欒仈绯绘柟寮�", trigger: "blur" } // 鑱旂郴鏂瑰紡
+ { required: true, message: "璇峰~鍐欒仈绯绘柟寮�", trigger: "blur" }, // 鑱旂郴鏂瑰紡
],
password: [
- { required: true, message: "璇峰~鍐欑櫥褰曞瘑鐮�", trigger: "blur" } // 鐧诲綍瀵嗙爜
- ]
+ { required: true, message: "璇峰~鍐欑櫥褰曞瘑鐮�", trigger: "blur" }, // 鐧诲綍瀵嗙爜
+ ],
},
editDropdownList: [],
enterpriseTypeList: [], // 浼佷笟绫诲瀷鍒楄〃
creditGradeList: [], // 淇$敤绛夌骇
supplyRangeList: [], // 渚涜揣鑼冨洿
currentType: 0,
- editDropdownTitle: ""
- }
+ editDropdownTitle: "",
+ };
},
mounted() {
- this.handleGetList(5)
- this.handleGetList(6)
- this.handleGetList(7)
+ this.handleGetList(5);
+ this.handleGetList(6);
+ this.handleGetList(7);
},
watch: {
editRow(val) {
if (val.id && this.islook) {
- this.initFormData(val)
+ this.initFormData(val);
} else {
this.$nextTick(() => {
- this.$refs.form.resetFields()
- })
+ this.$refs.form.resetFields();
+ });
}
},
islook(val) {
if (val) {
+ debugger
this.form = {
number: "",
name: "",
@@ -221,25 +291,26 @@
supplyCapacity: "",
organizationCode: "",
supplyRange: "",
- status: 0
- }
+ status: 0,
+ };
if (this.editRow && this.editRow.id) {
- this.initFormData(this.editRow)
+ this.initFormData(this.editRow);
} else {
this.$nextTick(() => {
- this.$refs.form.resetFields()
- })
+ this.$refs.form.resetFields();
+ this.$forceUpdate()
+ });
}
}
- }
+ },
},
methods: {
addPreProduction() {
- this.$refs.add.materialVisible = true
+ this.$refs.add.materialVisible = true;
},
initFormData(row) {
if (row.id) {
- this.form = JSON.parse(JSON.stringify(row))
+ this.form = JSON.parse(JSON.stringify(row));
// if (this.form.takerId && this.form.takerName) {
// this.form.takerObj = this.form.takerId + "&" + this.form.takerName;
// }
@@ -248,28 +319,29 @@
onSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
- let params = JSON.parse(JSON.stringify(this.form))
+ let params = JSON.parse(JSON.stringify(this.form));
// params.takerId = params.takerObj.split("&")[0];
// params.takerName = params.takerObj.split("&")[1];
if (this.editRow && this.editRow.id) {
- params.id = this.editRow.id
+ params.id = this.editRow.id;
updateEnterprise(params).then((res) => {
if (res.code == 200) {
- this.$message.success("缂栬緫鎴愬姛锛�")
- this.$emit("shutdown", this.form)
- this.shutdown()
+ this.$message.success("缂栬緫浼佷笟鎴愬姛锛�");
+ this.$emit("shutdown", this.form);
+ this.shutdown();
}
- })
+ });
} else {
addEnterprise(params).then((res) => {
if (res.code == 200) {
- console.log(res, "5555")
- this.addOutsideUser(res.data)
+ this.$message.success("鏂板浼佷笟鎴愬姛锛�");
+ this.$emit("shutdown", this.form);
+ this.shutdown();
}
- })
+ });
}
}
- })
+ });
},
// 娣诲姞澶栭儴鐢ㄦ埛
addOutsideUser(data) {
@@ -278,37 +350,44 @@
companyName: data.name,
companyNumber: data.number,
passWord: this.form.password,
- userName: data.tel
+ userName: data.tel,
}).then((res) => {
- console.log(res)
+ console.log(res);
if (res.code == 200) {
- this.$message.success("娣诲姞鎴愬姛锛�")
- this.$emit("shutdown", this.form)
- this.shutdown()
+ this.$message.success("娣诲姞鎴愬姛锛�");
+ this.$emit("shutdown", this.form);
+ this.shutdown();
}
- })
+ });
},
// 浼佷笟绫诲瀷?淇$敤绛夌骇/渚涜揣鑼冨洿鐐瑰嚮
handleCommonShow(type) {
- this.currentType = type
- this.editDropdownTitle = type == 5 ? "浼佷笟绫诲瀷" : type == 6 ? "淇$敤绛夌骇" : type == 7 ? "渚涜揣鑼冨洿" : ""
- this.editDropdownList = []
- this.handleGetList(type)
- this.$refs.editDialog.isvisible = true
+ this.currentType = type;
+ this.editDropdownTitle =
+ type == 5
+ ? "浼佷笟绫诲瀷"
+ : type == 6
+ ? "淇$敤绛夌骇"
+ : type == 7
+ ? "渚涜揣鑼冨洿"
+ : "";
+ this.editDropdownList = [];
+ this.handleGetList(type);
+ this.$refs.editDialog.isvisible = true;
},
// 鑾峰彇浼佷笟绫诲瀷?淇$敤绛夌骇/渚涜揣鑼冨洿
handleGetList(type) {
- this.currentType = type
+ this.currentType = type;
getMiniDictList({ type: type }).then((res) => {
- this.editDropdownList = res.data
+ this.editDropdownList = res.data;
if (type == 5) {
- this.enterpriseTypeList = res.data
+ this.enterpriseTypeList = res.data;
} else if (type == 6) {
- this.creditGradeList = res.data
+ this.creditGradeList = res.data;
} else if (type == 7) {
- this.supplyRangeList = res.data
+ this.supplyRangeList = res.data;
}
- })
+ });
},
// 淇濆瓨浼佷笟绫诲瀷?淇$敤绛夌骇/渚涜揣鑼冨洿
handleConfirmSave(data) {
@@ -316,31 +395,30 @@
if (res.code == 200) {
this.$message({
message: "鎿嶄綔鎴愬姛锛�",
- type: "success"
- })
- this.$refs.editDialog.isvisible = false
- this.handleGetList(this.currentType)
+ type: "success",
+ });
+ this.$refs.editDialog.isvisible = false;
+ this.handleGetList(this.currentType);
}
- })
+ });
},
shutdown() {
- this.$refs.form.resetFields()
- this.islook = false
+ this.$refs.form.resetFields();
+ this.islook = false;
},
// 闅忔満鐢熸垚鍏綅鏁板瘑鐮�
generateRandomNumber() {
- let passwordStr = Math.floor(100000 + Math.random() * 900000)
- console.log(passwordStr)
- this.$set(this.form, "password", passwordStr)
- }
- }
-}
+ let passwordStr = Math.floor(100000 + Math.random() * 900000);
+ console.log(passwordStr);
+ this.$set(this.form, "password", passwordStr);
+ },
+ },
+};
</script>
<style lang="scss" scoped>
.dialog-content-box {
- padding: 0px 30px;
- height:380px;
+ height:480px;
overflow-y:auto;
// overflow-y: auto;
// .el-form {
@@ -349,15 +427,25 @@
.login-password-box {
display: flex;
}
+ .basic-info-title {
+ background-color: #f4f8fe;
+ padding-left: 10px;
+ font-size: 15px;
+ font-weight: bold;
+ color: #666;
+ height: 42px;
+ line-height: 42px;
+ margin-bottom:15px;
+ }
+ .el-form{
+ padding: 0px 30px;
+ }
}
::v-deep {
.el-tabs__content {
height: calc(100% - 55px);
overflow-y: auto;
- }
- .el-dialog__body{
- padding-top:15px;
}
}
</style>
diff --git a/src/views/supplierManage/outsourceSupplier/index.vue b/src/views/supplierManage/outsourceSupplier/index.vue
index 9b597f7..2e4abaf 100644
--- a/src/views/supplierManage/outsourceSupplier/index.vue
+++ b/src/views/supplierManage/outsourceSupplier/index.vue
@@ -18,8 +18,15 @@
<div class="list-view">
<TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
<template slot="tableButton">
- <el-table-column label="鎿嶄綔" width="160" fixed="right">
+ <el-table-column label="鎿嶄綔" width="150" fixed="right">
<template slot-scope="scope">
+ <el-button
+ v-if="scope.row.tel.length == 0"
+ type="text"
+ size="small"
+ @click="createAccountClick(scope.row)"
+ >鍒涘缓璐﹀彿</el-button
+ >
<el-button v-if="scope.row.status == 1" type="text" size="small" @click="statusModifyClick(scope.row)"
>鍋滅敤</el-button
>
@@ -38,6 +45,12 @@
<!-- <div class="overSpread" v-show="isopen || isCreateShop"></div> -->
<!-- 娣诲姞/缂栬緫澶囦欢 -->
<AddEnterprise ref="add" :showList="showList" :titleName="titleName" :editRow="editRow" @shutdown="shutdown" />
+ <!-- 鍒涘缓璐﹀彿 -->
+ <CreateAccount
+ ref="create"
+ :editRow="createRow"
+ @shutdown="shutCreateDown"
+ />
</div>
</template>
@@ -49,12 +62,14 @@
editOutsideUser
} from "@/api/supplierManage/outsourceSupplier"
import AddEnterprise from "@/views/supplierManage/outsourceSupplier/components/addEnterprise"
+import CreateAccount from "@/views/supplierManage/outsourceSupplier/components/CreateAccount";
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
export default {
name: "outsourceManage",
mixins: [pageMixin],
components: {
- AddEnterprise
+ AddEnterprise,
+ CreateAccount
},
beforeMount() {
this.getData()
@@ -106,7 +121,8 @@
"娣诲姞鏃堕棿",
"鐘舵��"
],
- showList: []
+ showList: [],
+ createRow: {},
}
},
mounted() {
@@ -184,6 +200,7 @@
{
label: "缁勭粐鏈烘瀯浠g爜",
prop: "organizationCode",
+ min:140,
isShowColumn: showcol.includes("缁勭粐鏈烘瀯浠g爜"),
default: false
},
@@ -258,7 +275,7 @@
editClick(val) {
let params = JSON.parse(JSON.stringify(val))
this.titleName = "缂栬緫"
- this.editRow = { ...params, password: "000000" }
+ this.editRow = { ...params, password: "000000",id:params.id?params.id:params.ID, }
this.$refs.add.islook = true
},
// 鍚敤/鍋滅敤
@@ -274,15 +291,18 @@
updateEnterprise(params)
.then((reply) => {
if (reply && reply.code == 200) {
- this.editOutsideUser(row)
- // this.getData();
- // this.$message.success(row.status == 1 ? "鍋滅敤鎴愬姛" : "鍚敤鎴愬姛");
+ if(row.tel){
+ this.editOutsideUser(row)
+ }else{
+ this.getData()
+ this.$message.success(row.status == 1 ? "鍋滅敤鎴愬姛" : "鍚敤鎴愬姛")
+ }
+
} else {
this.$message.error(row.status == 1 ? "鍋滅敤澶辫触" : "鍚敤澶辫触")
}
})
- .catch(() => {})
- })
+ }).catch(() => {})
},
// 鍚敤鍋滅敤澶栭儴鐢ㄦ埛
editOutsideUser(row) {
@@ -304,7 +324,17 @@
// 鑾峰彇鐘舵��
getStatus(val) {
return val == 0 ? "鏂板缓" : val == 1 ? "鍚敤" : val == 2 ? "鍋滅敤" : "--"
- }
+ },
+ shutCreateDown() {
+ this.$refs.create.islook = false;
+ this.getData();
+ },
+ // 鍒涘缓璐﹀彿
+ createAccountClick(row) {
+ let params = JSON.parse(JSON.stringify(row))
+ this.createRow = { ...params,id:row.id?row.id:row.ID };
+ this.$refs.create.islook = true;
+ },
}
}
</script>
diff --git a/vue.config.js b/vue.config.js
index 34f3333..db22398 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -18,7 +18,7 @@
ws: true,
changeOrigin: true
},
- "/api": {
+ "/api-srm": {
// target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/
// target: "http://192.168.20.120:8004",
@@ -26,7 +26,12 @@
target: "http://192.168.20.119:8004", // http://192.168.20.119:8004 http://fai365.com:30150/
ws: true,
changeOrigin: true
- }
+ },
+ "/api":{
+ target:"http://192.168.20.119:8001",
+ ws: true,
+ changeOrigin: true
+ },
}
},
transpileDependencies: [
--
Gitblit v1.8.0