|
@@ -171,7 +171,12 @@
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="物料分类" prop="k3CategoryIds">
|
|
|
|
+ <el-select multiple v-model="AccountForm.k3CategoryIds" placeholder="请选择物料分类" style="width: 100%;" filterable>
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in categoryList" :key="index"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="cancelAccountForm">取 消</el-button>
|
|
<el-button @click="cancelAccountForm">取 消</el-button>
|
|
@@ -218,7 +223,7 @@ import {
|
|
changeAccountStatus,
|
|
changeAccountStatus,
|
|
resetPassword,
|
|
resetPassword,
|
|
} from "@/api/setting";
|
|
} from "@/api/setting";
|
|
-import { getDealerList } from "@/api/common";
|
|
|
|
|
|
+import { getDealerList ,getCategoryList } from "@/api/common";
|
|
import { findElem, downloadFiles, handleImportTwo } from "@/utils/util";
|
|
import { findElem, downloadFiles, handleImportTwo } from "@/utils/util";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -296,6 +301,7 @@ export default {
|
|
isDiscount: true,
|
|
isDiscount: true,
|
|
newPassword: "", // 新密码
|
|
newPassword: "", // 新密码
|
|
confirmPassword: "", // 确认密码
|
|
confirmPassword: "", // 确认密码
|
|
|
|
+ k3CategoryIds:[]
|
|
},
|
|
},
|
|
AccountFormRules: {
|
|
AccountFormRules: {
|
|
account: [{ required: true, message: "请输入账号", trigger: "blur" }],
|
|
account: [{ required: true, message: "请输入账号", trigger: "blur" }],
|
|
@@ -306,6 +312,9 @@ export default {
|
|
correspondIds: [
|
|
correspondIds: [
|
|
{ required: true, message: "请选择可用仓库", trigger: "change" },
|
|
{ required: true, message: "请选择可用仓库", trigger: "change" },
|
|
],
|
|
],
|
|
|
|
+ k3CategoryIds: [
|
|
|
|
+ { required: true, message: "请选择物料分类", trigger: "change" },
|
|
|
|
+ ],
|
|
newPassword: [
|
|
newPassword: [
|
|
{ required: true, validator: validatePass3, trigger: "blur" },
|
|
{ required: true, validator: validatePass3, trigger: "blur" },
|
|
],
|
|
],
|
|
@@ -314,7 +323,7 @@ export default {
|
|
],
|
|
],
|
|
},
|
|
},
|
|
editAccountId: null,
|
|
editAccountId: null,
|
|
-
|
|
|
|
|
|
+categoryList:[],
|
|
filterText: "",
|
|
filterText: "",
|
|
departmentList: [],
|
|
departmentList: [],
|
|
defaultProps: {
|
|
defaultProps: {
|
|
@@ -414,7 +423,20 @@ export default {
|
|
});
|
|
});
|
|
return result;
|
|
return result;
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ // 获
|
|
|
|
+ async getCategoryList() {
|
|
|
|
+ const result = await new Promise((resolve, reject) => {
|
|
|
|
+ getCategoryList({ pageNum: 1, pageSize: -1 })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.categoryList = res.data.records;
|
|
|
|
+ resolve(res.data);
|
|
|
|
+ })
|
|
|
|
+ .catch((res) => {
|
|
|
|
+ resolve([]);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ return result;
|
|
|
|
+ },
|
|
// 获取商户列表
|
|
// 获取商户列表
|
|
async getMerchantList() {
|
|
async getMerchantList() {
|
|
const result = await new Promise((resolve, reject) => {
|
|
const result = await new Promise((resolve, reject) => {
|
|
@@ -542,6 +564,8 @@ export default {
|
|
await this.getMerchantList();
|
|
await this.getMerchantList();
|
|
await this.getDealerList();
|
|
await this.getDealerList();
|
|
await this.getRoleList();
|
|
await this.getRoleList();
|
|
|
|
+ await this.getCategoryList()
|
|
|
|
+
|
|
if (type == "add") {
|
|
if (type == "add") {
|
|
if (this.selectDepartment) {
|
|
if (this.selectDepartment) {
|
|
this.$refs.tree.setCheckedKeys([this.selectDepartment.adminWebsitId]);
|
|
this.$refs.tree.setCheckedKeys([this.selectDepartment.adminWebsitId]);
|
|
@@ -561,6 +585,7 @@ export default {
|
|
this.AccountForm.company = res.data.parentCustomerId;
|
|
this.AccountForm.company = res.data.parentCustomerId;
|
|
this.AccountForm.isDiscount = res.data.isZr;
|
|
this.AccountForm.isDiscount = res.data.isZr;
|
|
this.AccountForm.correspondIds = res.data.stockCorrespondList;
|
|
this.AccountForm.correspondIds = res.data.stockCorrespondList;
|
|
|
|
+ this.AccountForm.k3CategoryIds =res.data.k3CategoryList
|
|
this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
|
|
this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -579,13 +604,28 @@ export default {
|
|
console.log(this.AccountForm.correspondIds);
|
|
console.log(this.AccountForm.correspondIds);
|
|
this.$refs.AccountForm.validate((valid) => {
|
|
this.$refs.AccountForm.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ const categoryIds=[]
|
|
|
|
+ this.categoryList.map(k=>{
|
|
|
|
+ this.AccountForm.k3CategoryIds.map(i=>{
|
|
|
|
+ if (i==k.id) {
|
|
|
|
+ categoryIds.push({
|
|
|
|
+ k3CategoryId:k.id,
|
|
|
|
+ k3CategoryName:k.name,
|
|
|
|
+ k3CategoryNumber:k.number
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
let params = {
|
|
let params = {
|
|
userName: this.AccountForm.account,
|
|
userName: this.AccountForm.account,
|
|
nickName: this.AccountForm.nickName,
|
|
nickName: this.AccountForm.nickName,
|
|
roleId: this.AccountForm.role,
|
|
roleId: this.AccountForm.role,
|
|
password: this.AccountForm.newPassword,
|
|
password: this.AccountForm.newPassword,
|
|
correspondIds: this.AccountForm.correspondIds,
|
|
correspondIds: this.AccountForm.correspondIds,
|
|
|
|
+ categoryIds
|
|
};
|
|
};
|
|
|
|
+
|
|
if (this.roleObj.type === 0) {
|
|
if (this.roleObj.type === 0) {
|
|
params.adminWebsitIds = this.$refs.tree.getCheckedKeys();
|
|
params.adminWebsitIds = this.$refs.tree.getCheckedKeys();
|
|
if (this.roleObj.name === "经销商") {
|
|
if (this.roleObj.name === "经销商") {
|