|
@@ -32,17 +32,17 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12"
|
|
|
><el-form-item
|
|
|
- label-width="140px"
|
|
|
+ label-width="140px"
|
|
|
label="仓库所在业务公司"
|
|
|
- prop="supplierNo"
|
|
|
+ prop="companyNo"
|
|
|
>
|
|
|
<search-work-company
|
|
|
- :value="ruleForm.company_id"
|
|
|
+ :value="ruleForm.companyNo"
|
|
|
:placeholder="'业务公司'"
|
|
|
- :disabled="false"
|
|
|
+ :disabled="isDetail"
|
|
|
:size="'mini'"
|
|
|
:isDetail="false"
|
|
|
- @searchChange="company_idsearchChange"
|
|
|
+ @searchChange="companyNosearchChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -50,7 +50,7 @@
|
|
|
><el-form-item
|
|
|
label="仓库所在公司"
|
|
|
prop="supplierNo"
|
|
|
- label-width="120px"
|
|
|
+ label-width="120px"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<search-supplier
|
|
@@ -79,7 +79,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="仓库类型" prop="wsmtype">
|
|
|
- <el-select v-model="ruleForm.wsmtype" style="width:100%" placeholder="仓库类型">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.wsmtype"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="isDetail"
|
|
|
+ placeholder="仓库类型"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
:key="item.value"
|
|
@@ -93,11 +98,11 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
label="仓库负责人"
|
|
|
- prop="contactor"
|
|
|
+ prop="contactor_id"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<search-account
|
|
|
- :value="ruleForm.contactor"
|
|
|
+ :value="ruleForm.contactor_id"
|
|
|
:placeholder="'仓库负责人'"
|
|
|
:is-detail="id !== 'add'"
|
|
|
:disabled="isDetail"
|
|
@@ -118,7 +123,11 @@
|
|
|
</el-input> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="仓库所在省/市/区" prop="addr_code" label-width="140px">
|
|
|
+ <el-form-item
|
|
|
+ label="仓库所在省/市/区"
|
|
|
+ prop="addr_code"
|
|
|
+ label-width="140px"
|
|
|
+ >
|
|
|
<select-area
|
|
|
:placeholder="'仓库所在省/市/区'"
|
|
|
:value="ruleForm.addr_code"
|
|
@@ -130,7 +139,11 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="仓库所在详细地址" prop="addr" label-width="140px">
|
|
|
+ <el-form-item
|
|
|
+ label="仓库所在详细地址"
|
|
|
+ prop="addr"
|
|
|
+ label-width="140px"
|
|
|
+ >
|
|
|
<el-input
|
|
|
placeholder="仓库所在详细地址"
|
|
|
v-model="ruleForm.addr"
|
|
@@ -146,10 +159,10 @@
|
|
|
<el-divider content-position="center">收发货信息</el-divider>
|
|
|
</div>
|
|
|
<el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="收发货联系人" prop="wsm_name" label-width="110px">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="联系人" prop="wsm_name" label-width="68px">
|
|
|
<el-input
|
|
|
- placeholder="收发货联系人"
|
|
|
+ placeholder="联系人"
|
|
|
maxlength="20"
|
|
|
:disabled="isDetail"
|
|
|
v-model="ruleForm.wsm_name"
|
|
@@ -157,10 +170,21 @@
|
|
|
>
|
|
|
</el-input> </el-form-item
|
|
|
></el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="收发货电话" prop="wsm_mobile">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="职位" prop="position" label-width="55px">
|
|
|
+ <el-input
|
|
|
+ placeholder="职位"
|
|
|
+ maxlength="20"
|
|
|
+ :disabled="isDetail"
|
|
|
+ v-model="ruleForm.position"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="电话" prop="wsm_mobile" label-width="55px">
|
|
|
<el-input
|
|
|
- placeholder="收发货电话"
|
|
|
+ placeholder="电话"
|
|
|
v-model="ruleForm.wsm_mobile"
|
|
|
maxlength="11"
|
|
|
:disabled="isDetail"
|
|
@@ -172,7 +196,11 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="收发货省/市/区" prop="addrs_code" label-width="121px">
|
|
|
+ <el-form-item
|
|
|
+ label="收发货省/市/区"
|
|
|
+ prop="addrs_code"
|
|
|
+ label-width="121px"
|
|
|
+ >
|
|
|
<select-area
|
|
|
:is-detail="id !== 'add'"
|
|
|
:disabled="isDetail"
|
|
@@ -183,7 +211,11 @@
|
|
|
/> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="收发货详细地址" prop="wsm_addr" label-width="126px">
|
|
|
+ <el-form-item
|
|
|
+ label="收发货详细地址"
|
|
|
+ prop="wsm_addr"
|
|
|
+ label-width="126px"
|
|
|
+ >
|
|
|
<el-input
|
|
|
placeholder="收发货详细地址"
|
|
|
maxlength="100"
|
|
@@ -259,26 +291,37 @@ export default {
|
|
|
title: "添加仓库",
|
|
|
showModelThis: this.showModel,
|
|
|
options: [
|
|
|
+ // {
|
|
|
+ // value: "1",
|
|
|
+ // label: "系统仓",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // value: "2",
|
|
|
+ // label: "虚拟仓",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // value: "3",
|
|
|
+ // label: "自建仓",
|
|
|
+ // },
|
|
|
{
|
|
|
- value: "1",
|
|
|
+ value: "5",
|
|
|
label: "销售仓",
|
|
|
},
|
|
|
- {
|
|
|
- value: "0",
|
|
|
+ {
|
|
|
+ value: "4",
|
|
|
label: "次品仓",
|
|
|
},
|
|
|
],
|
|
|
ruleForm: {
|
|
|
- company_id: "",
|
|
|
+ companyNo: "",
|
|
|
name: "", // 仓库名称
|
|
|
supplierNo: [], //供应商编码
|
|
|
- // wsmtype: "", //仓库类型 目前随便填
|
|
|
+ wsmtype: "", //仓库类型 目前随便填
|
|
|
addr_code: [], //仓库省市区
|
|
|
addr: "", //仓库详细地址
|
|
|
- contactor: [], //仓库联系人
|
|
|
+ contactor_id: [], //仓库联系人
|
|
|
mobile: "", //仓库联系方式
|
|
|
- // position: "", //联系人职位 目前随便填
|
|
|
- // wsm_type: "", //目前随便填
|
|
|
+ position: "", //联系人职位 目前随便填
|
|
|
|
|
|
wsm_name: "", //收发货联系人
|
|
|
wsm_mobile: "", //收发货联系方式
|
|
@@ -288,15 +331,15 @@ export default {
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
name: [
|
|
|
- { required: true, message: "仓库名称", trigger: "blur" },
|
|
|
- {
|
|
|
- min: 1,
|
|
|
- max: 20,
|
|
|
- message: "长度在 1 到 20 个字符",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ { required: true, message: "仓库名称不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ position: [
|
|
|
+ { required: true, message: "联系人职位不能为空", trigger: "blur" },
|
|
|
],
|
|
|
- company_id: [
|
|
|
+ wsmtype: [
|
|
|
+ { required: true, message: "请选择仓库类型", trigger: "change" },
|
|
|
+ ],
|
|
|
+ companyNo: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "业务公司不能为空",
|
|
@@ -329,7 +372,7 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
|
|
|
- contactor: [
|
|
|
+ contactor_id: [
|
|
|
{
|
|
|
required: true,
|
|
|
type: "array",
|
|
@@ -396,10 +439,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
//业务公司选择
|
|
|
- async company_idsearchChange(e) {
|
|
|
+ async companyNosearchChange(e) {
|
|
|
const { id, code, label } = e;
|
|
|
- this.ruleForm.company_id = code || "";
|
|
|
- this.$refs.ruleForm.validateField("company_id");
|
|
|
+ this.ruleForm.companyNo = code || "";
|
|
|
+ this.$refs.ruleForm.validateField("companyNo");
|
|
|
},
|
|
|
//供应商公司选择
|
|
|
supplierChange(e) {
|
|
@@ -423,11 +466,11 @@ export default {
|
|
|
//负责人选择
|
|
|
accountChange(e) {
|
|
|
if (e && e.id) {
|
|
|
- this.ruleForm.contactor = [e.id];
|
|
|
+ this.ruleForm.contactor_id = [e.id];
|
|
|
} else {
|
|
|
- this.ruleForm.contactor = [];
|
|
|
+ this.ruleForm.contactor_id = [];
|
|
|
}
|
|
|
- this.$refs.ruleForm.validateField("contactor");
|
|
|
+ this.$refs.ruleForm.validateField("contactor_id");
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.supplier_name = "";
|
|
@@ -466,22 +509,24 @@ export default {
|
|
|
wsm_code,
|
|
|
wsm_mobile,
|
|
|
wsm_name,
|
|
|
- company_id,
|
|
|
+ companyNo,
|
|
|
+ position,
|
|
|
+ wsm_type,
|
|
|
} = res.data;
|
|
|
|
|
|
this.supplier_name = supplier_name;
|
|
|
this.accountNames = contactor_name;
|
|
|
this.ruleForm = {
|
|
|
- company_id: company_id || "",
|
|
|
+ companyNo: companyNo || "",
|
|
|
name: name, // 仓库名称
|
|
|
supplierNo: [supplierNo], //供应商编码
|
|
|
- // wsmtype: "", //仓库类型 目前随便填
|
|
|
+ wsmtype: wsm_type || "", //仓库类型 目前随便填
|
|
|
addr_code: this.getCode(addr_code), //仓库省市区
|
|
|
addr: addr, //仓库详细地址
|
|
|
- contactor: contactor ? [contactor] : [], //仓库联系人
|
|
|
+ contactor_id: contactor ? [contactor] : [], //仓库联系人
|
|
|
mobile: mobile, //仓库联系方式
|
|
|
- // position: "", //联系人职位 目前随便填
|
|
|
- // wsm_type: "", //目前随便填
|
|
|
+ position: position || "", //联系人职位 目前随便填
|
|
|
+ wsm_type: "", //目前随便填
|
|
|
|
|
|
wsm_name: wsm_name, //收发货联系人
|
|
|
wsm_mobile: wsm_mobile, //收发货联系方式
|
|
@@ -507,15 +552,15 @@ export default {
|
|
|
this.supplier_name = "";
|
|
|
this.accountNames = "";
|
|
|
this.ruleForm = {
|
|
|
- company_id: "",
|
|
|
+ companyNo: "",
|
|
|
name: "", // 仓库名称
|
|
|
supplierNo: [], //供应商编码
|
|
|
- // wsmtype: "", //仓库类型 目前随便填
|
|
|
+ wsmtype: "", //仓库类型 目前随便填
|
|
|
addr_code: [], //仓库省市区
|
|
|
addr: "", //仓库详细地址
|
|
|
- contactor: [], //仓库联系人
|
|
|
+ contactor_id: [], //仓库联系人
|
|
|
mobile: "", //仓库联系方式
|
|
|
- // position: "", //联系人职位 目前随便填
|
|
|
+ position: "", //联系人职位 目前随便填
|
|
|
// wsm_type: "", //目前随便填
|
|
|
|
|
|
wsm_name: "", //收发货联系人
|
|
@@ -554,29 +599,34 @@ export default {
|
|
|
supplierNo,
|
|
|
addr_code,
|
|
|
addr,
|
|
|
- contactor,
|
|
|
+ contactor_id,
|
|
|
mobile,
|
|
|
wsm_name,
|
|
|
wsm_mobile,
|
|
|
wsm_addr,
|
|
|
addrs_code,
|
|
|
+ companyNo,
|
|
|
+ position,
|
|
|
+ wsmtype,
|
|
|
} = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
const model = {
|
|
|
id: this.id,
|
|
|
+ companyNo,
|
|
|
name,
|
|
|
supplierNo: this.getId(supplierNo),
|
|
|
addr_code: this.setCode(addr_code),
|
|
|
addr,
|
|
|
- contactor: this.getId(contactor),
|
|
|
+ contactor_id: this.getId(contactor_id),
|
|
|
mobile,
|
|
|
wsm_name,
|
|
|
wsm_mobile,
|
|
|
wsm_addr,
|
|
|
addrs_code: this.setCode(addrs_code),
|
|
|
- position: "1", //暂时随便填
|
|
|
- wsm_type: "1", //后台暂时不用
|
|
|
- wsmtype: "1", //后台暂时不用
|
|
|
+ position,
|
|
|
+ // wsm_type: "", //目前随便填
|
|
|
+ wsmtype,
|
|
|
};
|
|
|
+ console.log(model);
|
|
|
let res = {};
|
|
|
if (this.id === "add") {
|
|
|
delete model["id"];
|