|
@@ -26,12 +26,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="仓库名称" prop="stockName">
|
|
|
+ <el-form-item label="仓库名称" prop="accountName">
|
|
|
<el-input
|
|
|
placeholder="请输入仓库名称"
|
|
|
filterable
|
|
|
clearable
|
|
|
- v-model="ruleForm.stockName"
|
|
|
+ v-model="ruleForm.accountName"
|
|
|
@change="getValue1"
|
|
|
>
|
|
|
</el-input>
|
|
@@ -41,18 +41,18 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<!-- 省/市/区选择组件 -->
|
|
|
- <el-form-item label="省/市/区" prop="stockToArea">
|
|
|
+ <el-form-item label="省/市/区" prop="accountToArea">
|
|
|
<select-area @areaSelect="areaSelect"></select-area>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12"
|
|
|
><!-- 仓库详细地址 -->
|
|
|
- <el-form-item label="详细地址" prop="stockDetail">
|
|
|
+ <el-form-item label="详细地址" prop="accountDetail">
|
|
|
<el-input
|
|
|
placeholder="请输入内容"
|
|
|
- v-model="ruleForm.stockDetail"
|
|
|
+ v-model="ruleForm.accountDetail"
|
|
|
clearable
|
|
|
- @change="stockDetail"
|
|
|
+ @change="accountDetail"
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -61,25 +61,16 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="负责人" prop="stockDutyer" style="width: 100%">
|
|
|
- <el-select
|
|
|
- style="width: 100%"
|
|
|
- v-model="ruleForm.stockDutyer"
|
|
|
- placeholder="请选择仓库负责人"
|
|
|
- @change="getValue2"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in ruleForm.stockDutyer_options"
|
|
|
- :key="index"
|
|
|
- :label="item.nickname"
|
|
|
- :value="item.nickname"
|
|
|
- >
|
|
|
- <span style="float: left">{{ item.nickname }}</span>
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">{{
|
|
|
- item.role_name
|
|
|
- }}</span>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="负责人" prop="accountDutyer" style="width: 100%">
|
|
|
+ <search-account
|
|
|
+ :size="searchSize"
|
|
|
+ :code="accountNo"
|
|
|
+ :placeholder="'请输入负责人'"
|
|
|
+ :is-detail="true"
|
|
|
+ :disabled="false"
|
|
|
+ :names="accountNames"
|
|
|
+ @change="accountChange"
|
|
|
+ />
|
|
|
</el-form-item></el-col
|
|
|
>
|
|
|
<el-col :span="12">
|
|
@@ -127,7 +118,7 @@
|
|
|
<el-col :span="12">
|
|
|
<!-- 收发货地址 -->
|
|
|
<el-form-item label="省/市/区" prop="linker_addr">
|
|
|
- <AreaSelect @areaSelect="selectArea"></AreaSelect> </el-form-item
|
|
|
+ <select-area @areaSelect="selectArea"/> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="12">
|
|
|
<!-- 收发货详细地址 -->
|
|
@@ -163,18 +154,18 @@
|
|
|
clearable
|
|
|
style="width: 100%"
|
|
|
v-model="ruleForm.storeToCompany"
|
|
|
- :options="ruleForm.selectStock_go_options"
|
|
|
+ :options="ruleForm.selectaccount_go_options"
|
|
|
@change="getValue"
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="仓库名称" prop="stockName">
|
|
|
+ <el-form-item label="仓库名称" prop="accountName">
|
|
|
<el-input
|
|
|
placeholder="请输入仓库名称"
|
|
|
filterable
|
|
|
clearable
|
|
|
- v-model="ruleForm.stockName"
|
|
|
+ v-model="ruleForm.accountName"
|
|
|
@change="getValue1"
|
|
|
>
|
|
|
</el-input>
|
|
@@ -184,31 +175,31 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<!-- 省/市/区选择组件 -->
|
|
|
- <el-form-item label="省/市/区" prop="stockToArea">
|
|
|
+ <el-form-item label="省/市/区" prop="accountToArea">
|
|
|
<select-area @areaSelect="areaSelect"></select-area>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12"
|
|
|
><!-- 仓库详细地址 -->
|
|
|
- <el-form-item label="详细地址" prop="stockDetail">
|
|
|
+ <el-form-item label="详细地址" prop="accountDetail">
|
|
|
<el-input
|
|
|
placeholder="请输入内容"
|
|
|
- v-model="ruleForm.stockDetail"
|
|
|
+ v-model="ruleForm.accountDetail"
|
|
|
clearable
|
|
|
- @change="stockDetail"
|
|
|
+ @change="accountDetail"
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-form-item label="负责人" prop="stockDutyer" style="width: 50%">
|
|
|
+ <el-form-item label="负责人" prop="accountDutyer" style="width: 50%">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.stockDutyer"
|
|
|
+ v-model="ruleForm.accountDutyer"
|
|
|
placeholder="请选择仓库负责人"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in ruleForm.stockDutyer_options"
|
|
|
+ v-for="item in ruleForm.accountDutyer_options"
|
|
|
:key="item.id"
|
|
|
:label="item.nickname"
|
|
|
:value="item.id"
|
|
@@ -331,7 +322,9 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
- stockDutyer: "", //仓库负责人
|
|
|
+ stockNo: [""],
|
|
|
+ stockNames: "",
|
|
|
+ accountDutyer: "", //仓库负责人
|
|
|
// addId: this.$route.query.id,
|
|
|
addId: "",
|
|
|
// route: this.$route,
|
|
@@ -348,18 +341,18 @@ export default {
|
|
|
},
|
|
|
ruleForm: {
|
|
|
storeToCompany: "",
|
|
|
- selectStock_go: "", //公司
|
|
|
- stockName: "", //仓库名称
|
|
|
- stockDutyer: "", //仓库负责人
|
|
|
+ selectaccount_go: "", //公司
|
|
|
+ accountName: "", //仓库名称
|
|
|
+ accountDutyer: "", //仓库负责人
|
|
|
dutyer_mobile: "",
|
|
|
linker: "", //收发货联系人
|
|
|
linker_mobile: "", //收发货人联系电话
|
|
|
linker_detail: "",
|
|
|
// linker_addr: [], //收发货地址
|
|
|
- // stockDutyer_options: [], //仓库负责人列表
|
|
|
- // stockDetail: [], //仓库详细地址
|
|
|
- // selectStock_go_options: [], //公司列表
|
|
|
- // stockToArea: [],
|
|
|
+ // accountDutyer_options: [], //仓库负责人列表
|
|
|
+ // accountDetail: [], //仓库详细地址
|
|
|
+ // selectaccount_go_options: [], //公司列表
|
|
|
+ // accountToArea: [],
|
|
|
}, //
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
@@ -372,14 +365,14 @@ export default {
|
|
|
// trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- stockName: [
|
|
|
+ accountName: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入仓库名称",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- stockDutyer: [
|
|
|
+ accountDutyer: [
|
|
|
{
|
|
|
// type: "array",
|
|
|
required: true,
|
|
@@ -388,7 +381,7 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- stockToArea: [
|
|
|
+ accountToArea: [
|
|
|
{
|
|
|
type: "array",
|
|
|
required: true,
|
|
@@ -396,7 +389,7 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- stockDetail: [
|
|
|
+ accountDetail: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择仓库详细地址",
|
|
@@ -471,6 +464,9 @@ export default {
|
|
|
this.initForm();
|
|
|
},
|
|
|
methods: {
|
|
|
+ stockChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ },
|
|
|
// 获取公司列表
|
|
|
getCompanyName(val) {
|
|
|
this.ruleForm.storeToCompany = val[1];
|
|
@@ -485,14 +481,14 @@ export default {
|
|
|
this.parmValue.wsm_name = val;
|
|
|
},
|
|
|
// 仓库详细地址
|
|
|
- stockDetail(val) {
|
|
|
+ accountDetail(val) {
|
|
|
console.log(val);
|
|
|
this.parmValue.addr = val;
|
|
|
},
|
|
|
//仓库地址选择
|
|
|
areaSelect(val) {
|
|
|
console.log(val);
|
|
|
- this.ruleForm.stockToArea = val;
|
|
|
+ this.ruleForm.accountToArea = val;
|
|
|
this.parmValue.addr = val;
|
|
|
},
|
|
|
// 收发货地址选择
|
|
@@ -517,7 +513,7 @@ export default {
|
|
|
// 负责人
|
|
|
getValue2(val) {
|
|
|
console.log(val);
|
|
|
- this.stockDutyer = val;
|
|
|
+ this.accountDutyer = val;
|
|
|
},
|
|
|
closeModel() {
|
|
|
console.log("closeModel!!");
|
|
@@ -527,14 +523,14 @@ export default {
|
|
|
// await this.getClist();
|
|
|
// await this.getRole();
|
|
|
this.ruleForm = {
|
|
|
- stockName: "my-Stock", //仓库名称
|
|
|
- stockDutyer: "", //仓库负责人
|
|
|
+ accountName: "my-account", //仓库名称
|
|
|
+ accountDutyer: "", //仓库负责人
|
|
|
linker: "", //收发货联系人
|
|
|
|
|
|
linker_mobile: "", //收发货人联系电话
|
|
|
linker_addr: "", //收发货地址
|
|
|
- selectStock_go_options: [],
|
|
|
- stockDutyer_options: [],
|
|
|
+ selectaccount_go_options: [],
|
|
|
+ accountDutyer_options: [],
|
|
|
};
|
|
|
console.log(this.addId);
|
|
|
if (this.addId === "add") {
|
|
@@ -601,15 +597,15 @@ export default {
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
this.ruleForm = {
|
|
|
dutyer_mobile: "18818818818",
|
|
|
- stockDetail: "顺义区宏远888",
|
|
|
- selectStock_go: "", //出库仓库
|
|
|
- selectStock_go_options: [], //出库仓库列表
|
|
|
- stockName: "my-STock", //仓库名称
|
|
|
+ accountDetail: "顺义区宏远888",
|
|
|
+ selectaccount_go: "", //出库仓库
|
|
|
+ selectaccount_go_options: [], //出库仓库列表
|
|
|
+ accountName: "my-account", //仓库名称
|
|
|
linker: "张三",
|
|
|
linker_mobile: "13223289230",
|
|
|
linker_detail: "朝阳区太阳城666",
|
|
|
- stockDutyer: "", //仓库负责人
|
|
|
- stockDutyer_options: [], //仓库负责人列表
|
|
|
+ accountDutyer: "", //仓库负责人
|
|
|
+ accountDutyer_options: [], //仓库负责人列表
|
|
|
};
|
|
|
if (this.id === "add" || this.isDetail) {
|
|
|
this.rules.username[0].required = false;
|
|
@@ -619,11 +615,11 @@ export default {
|
|
|
},
|
|
|
async submitForm(formName) {
|
|
|
let paraValue = {
|
|
|
- name: this.ruleForm.stockName,
|
|
|
+ name: this.ruleForm.accountName,
|
|
|
supplierNo: this.ruleForm.storeToCompany,
|
|
|
wsmtype: "1", //仓库类型
|
|
|
- addr: this.ruleForm.stockDetail, //仓库地址
|
|
|
- contactor: this.stockDutyer, //仓库联系人职位
|
|
|
+ addr: this.ruleForm.accountDetail, //仓库地址
|
|
|
+ contactor: this.accountDutyer, //仓库联系人职位
|
|
|
mobile: this.ruleForm.dutyer_mobile, //仓库联系人
|
|
|
position: "采购",
|
|
|
// wsm_type:"",后台暂时不用
|
|
@@ -636,9 +632,9 @@ export default {
|
|
|
},
|
|
|
wsm_addr: this.ruleForm.linker_detail,
|
|
|
addrs_code: {
|
|
|
- // provice_code: this.ruleForm.stockToArea[0],
|
|
|
- // city_code: this.ruleForm.stockToArea[1],
|
|
|
- // area_code: this.ruleForm.stockToArea[2],
|
|
|
+ // provice_code: this.ruleForm.accountToArea[0],
|
|
|
+ // city_code: this.ruleForm.accountToArea[1],
|
|
|
+ // area_code: this.ruleForm.accountToArea[2],
|
|
|
},
|
|
|
};
|
|
|
console.log(paraValue);
|
|
@@ -677,16 +673,16 @@ export default {
|
|
|
const res = await asyncRequest.getlist(obj);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
const { list } = res.data;
|
|
|
- this.ruleForm.stockDutyer_options = list;
|
|
|
- console.log(this.ruleForm.stockDutyer_options);
|
|
|
+ this.ruleForm.accountDutyer_options = list;
|
|
|
+ console.log(this.ruleForm.accountDutyer_options);
|
|
|
// console.log(res.data.list);
|
|
|
// res.data.list.forEach((element) => {
|
|
|
// // let dutyer = {
|
|
|
// // label: element.nickname,
|
|
|
// // value: element.depart[0] ? element.depart[0].name : "",
|
|
|
// // };
|
|
|
- // // console.log(this.ruleForm.stockDutyer_options);
|
|
|
- // this.ruleForm.stockDutyer_options.push(element);
|
|
|
+ // // console.log(this.ruleForm.accountDutyer_options);
|
|
|
+ // this.ruleForm.accountDutyer_options.push(element);
|
|
|
// });
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
@@ -710,11 +706,11 @@ export default {
|
|
|
label: element.name,
|
|
|
value: element.code,
|
|
|
};
|
|
|
- // console.log(this.ruleForm.selectStock_go_options);
|
|
|
- this.ruleForm.selectStock_go_options.push(company);
|
|
|
- // this.ruleForm.stockDutyer_options.push(dutyer);
|
|
|
+ // console.log(this.ruleForm.selectaccount_go_options);
|
|
|
+ this.ruleForm.selectaccount_go_options.push(company);
|
|
|
+ // this.ruleForm.accountDutyer_options.push(dutyer);
|
|
|
});
|
|
|
- // console.log(this.ruleForm.selectStock_go_options);
|
|
|
+ // console.log(this.ruleForm.selectaccount_go_options);
|
|
|
// this.tableData = res.data.list;
|
|
|
// this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
@@ -727,10 +723,10 @@ export default {
|
|
|
this.loading = false;
|
|
|
},
|
|
|
// 新建仓库
|
|
|
- async addStock() {
|
|
|
+ async addaccount() {
|
|
|
this.loading = true;
|
|
|
console.log(this.parmValue);
|
|
|
- const res = await asyncRequest.addStock(this.parmValue);
|
|
|
+ const res = await asyncRequest.addaccount(this.parmValue);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
console.log(res.data.list);
|
|
|
res.data.list.forEach((element) => {
|
|
@@ -739,10 +735,10 @@ export default {
|
|
|
label: element.name,
|
|
|
value: element.code,
|
|
|
};
|
|
|
- this.ruleForm.selectStock_go_options.push(company);
|
|
|
- // this.ruleForm.stockDutyer_options.push(dutyer);
|
|
|
+ this.ruleForm.selectaccount_go_options.push(company);
|
|
|
+ // this.ruleForm.accountDutyer_options.push(dutyer);
|
|
|
});
|
|
|
- console.log(this.ruleForm.selectStock_go_options);
|
|
|
+ console.log(this.ruleForm.selectaccount_go_options);
|
|
|
// this.tableData = res.data.list;
|
|
|
// this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
@@ -766,10 +762,10 @@ export default {
|
|
|
label: element.name,
|
|
|
value: element.code,
|
|
|
};
|
|
|
- this.ruleForm.selectStock_go_options.push(company);
|
|
|
- // this.ruleForm.stockDutyer_options.push(dutyer);
|
|
|
+ this.ruleForm.selectaccount_go_options.push(company);
|
|
|
+ // this.ruleForm.accountDutyer_options.push(dutyer);
|
|
|
});
|
|
|
- console.log(this.ruleForm.selectStock_go_options);
|
|
|
+ console.log(this.ruleForm.selectaccount_go_options);
|
|
|
// this.tableData = res.data.list;
|
|
|
// this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|