|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
+ v-loading="loading"
|
|
|
:title="title"
|
|
|
:center="true"
|
|
|
align="left"
|
|
|
top="8vh"
|
|
|
width="1040px"
|
|
|
- @close="showModelThis = false"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="showModelThis"
|
|
|
- v-loading="loading"
|
|
|
element-loading-text="拼命加载中"
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ @close="showModelThis = false"
|
|
|
>
|
|
|
<el-card style="margin-top: -20px">
|
|
|
<el-row :gutter="10">
|
|
@@ -30,21 +30,22 @@
|
|
|
</div>
|
|
|
|
|
|
<el-row>
|
|
|
- <el-col :span="12"
|
|
|
- ><el-form-item
|
|
|
- label-width="140px"
|
|
|
- label="仓库所在业务公司"
|
|
|
- prop="companyNo"
|
|
|
- >
|
|
|
- <search-work-company
|
|
|
- :value="ruleForm.companyNo"
|
|
|
- :placeholder="'业务公司'"
|
|
|
- :disabled="isDetail"
|
|
|
- :size="'mini'"
|
|
|
- :isDetail="false"
|
|
|
- @searchChange="companyNosearchChange"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+ <el-col
|
|
|
+ :span="12"
|
|
|
+ ><el-form-item
|
|
|
+ label-width="140px"
|
|
|
+ label="仓库所在业务公司"
|
|
|
+ prop="companyNo"
|
|
|
+ >
|
|
|
+ <search-work-company
|
|
|
+ :value="ruleForm.companyNo"
|
|
|
+ :placeholder="'业务公司'"
|
|
|
+ :disabled="isDetail"
|
|
|
+ :size="'mini'"
|
|
|
+ :is-detail="false"
|
|
|
+ @searchChange="companyNosearchChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="12"
|
|
|
><el-form-item
|
|
@@ -67,14 +68,13 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="仓库名称" prop="name">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.name"
|
|
|
placeholder="仓库名称"
|
|
|
filterable
|
|
|
:disabled="isDetail"
|
|
|
maxlength="50"
|
|
|
clearable
|
|
|
- v-model="ruleForm.name"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -90,8 +90,7 @@
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -105,19 +104,16 @@
|
|
|
:size="'mini'"
|
|
|
:names="accountNames"
|
|
|
@searchChange="accountChange"
|
|
|
- /> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="负责人电话" prop="mobile">
|
|
|
<el-input
|
|
|
- placeholder="联系人电话"
|
|
|
v-model="ruleForm.mobile"
|
|
|
+ placeholder="联系人电话"
|
|
|
maxlength="11"
|
|
|
clearable
|
|
|
:disabled="isDetail"
|
|
|
- >
|
|
|
- </el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
label="仓库所在省/市/区"
|
|
@@ -137,13 +133,12 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="仓库所在详细地址" prop="addr" label-width="140px">
|
|
|
<el-input
|
|
|
- placeholder="仓库所在详细地址"
|
|
|
v-model="ruleForm.addr"
|
|
|
+ placeholder="仓库所在详细地址"
|
|
|
maxlength="100"
|
|
|
clearable
|
|
|
:disabled="isDetail"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -154,36 +149,30 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="联系人" prop="wsm_name" label-width="68px">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.wsm_name"
|
|
|
placeholder="联系人"
|
|
|
maxlength="20"
|
|
|
:disabled="isDetail"
|
|
|
- v-model="ruleForm.wsm_name"
|
|
|
clearable
|
|
|
- >
|
|
|
- </el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="职位" prop="position" label-width="55px">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.position"
|
|
|
placeholder="职位"
|
|
|
maxlength="20"
|
|
|
:disabled="isDetail"
|
|
|
- v-model="ruleForm.position"
|
|
|
clearable
|
|
|
- >
|
|
|
- </el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="电话" prop="wsm_mobile" label-width="55px">
|
|
|
<el-input
|
|
|
- placeholder="电话"
|
|
|
v-model="ruleForm.wsm_mobile"
|
|
|
+ placeholder="电话"
|
|
|
maxlength="11"
|
|
|
:disabled="isDetail"
|
|
|
clearable
|
|
|
- >
|
|
|
- </el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
@@ -200,25 +189,26 @@
|
|
|
:value="ruleForm.addrs_code"
|
|
|
:placeholder="'收发货省/市/区'"
|
|
|
@selectChange="selectAreaAddrs_code"
|
|
|
- /> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="收发货详细地址" prop="wsm_addr" label-width="126px">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.wsm_addr"
|
|
|
placeholder="收发货详细地址"
|
|
|
maxlength="100"
|
|
|
:disabled="isDetail"
|
|
|
- v-model="ruleForm.wsm_addr"
|
|
|
clearable
|
|
|
- >
|
|
|
- </el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ /> </el-form-item></el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" :size="'mini'" @click="submitForm" v-if="!isDetail"
|
|
|
- >保 存
|
|
|
+ <el-button
|
|
|
+ v-if="!isDetail"
|
|
|
+ type="primary"
|
|
|
+ :size="'mini'"
|
|
|
+ @click="submitForm"
|
|
|
+ >保 存
|
|
|
</el-button>
|
|
|
<el-button :size="'mini'" @click="showModelThis = false">{{
|
|
|
isDetail ? "关 闭" : "取 消"
|
|
@@ -229,60 +219,60 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/service/serviceParam/storeSet";
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
-import { isMobile, isSpecialSymbol, hasSpace, isAddr } from "@/utils/validate";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
+import asyncRequest from '@/apis/service/serviceParam/storeSet'
|
|
|
+import resToken from '@/mixins/resToken'
|
|
|
+import { isMobile, isSpecialSymbol, hasSpace, isAddr } from '@/utils/validate'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
- name: "storeSet",
|
|
|
- props: ["showModel", "id", "isDetail"],
|
|
|
+ name: 'StoreSet',
|
|
|
mixins: [resToken],
|
|
|
+ props: ['showModel', 'id', 'isDetail'],
|
|
|
computed: {
|
|
|
- ...mapGetters(["business_companyNo"]),
|
|
|
+ ...mapGetters(['business_companyNo'])
|
|
|
},
|
|
|
data() {
|
|
|
const validatemobile = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("联系方式不能为空!"));
|
|
|
+ if (value === '') {
|
|
|
+ callback(new Error('联系方式不能为空!'))
|
|
|
} else {
|
|
|
if (!isMobile(value)) {
|
|
|
- callback(new Error("联系方式格式不正确!"));
|
|
|
+ callback(new Error('联系方式格式不正确!'))
|
|
|
} else {
|
|
|
- callback();
|
|
|
+ callback()
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
const validatewsmmobile = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("联系方式不能为空!"));
|
|
|
+ if (value === '') {
|
|
|
+ callback(new Error('联系方式不能为空!'))
|
|
|
} else {
|
|
|
if (!isMobile(value)) {
|
|
|
- callback(new Error("联系方式格式不正确!"));
|
|
|
+ callback(new Error('联系方式格式不正确!'))
|
|
|
} else {
|
|
|
- callback();
|
|
|
+ callback()
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
const validateAddr = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("详细地址不能为空!"));
|
|
|
+ if (value === '') {
|
|
|
+ callback(new Error('详细地址不能为空!'))
|
|
|
} else {
|
|
|
if (hasSpace(value)) {
|
|
|
- callback(new Error("不能出现/回车/换行符!"));
|
|
|
+ callback(new Error('不能出现/回车/换行符!'))
|
|
|
} else if (isSpecialSymbol(value)) {
|
|
|
- callback(new Error("不能使用英文特殊字符!"));
|
|
|
+ callback(new Error('不能使用英文特殊字符!'))
|
|
|
} else if (isAddr(value)) {
|
|
|
- callback();
|
|
|
+ callback()
|
|
|
} else {
|
|
|
- callback(new Error("详细地址填写不规范!"));
|
|
|
+ callback(new Error('详细地址填写不规范!'))
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
return {
|
|
|
- supplier_name: "",
|
|
|
- accountNames: "",
|
|
|
+ supplier_name: '',
|
|
|
+ accountNames: '',
|
|
|
loading: false,
|
|
|
- title: "添加仓库",
|
|
|
+ title: '添加仓库',
|
|
|
showModelThis: this.showModel,
|
|
|
options: [
|
|
|
// {
|
|
@@ -298,41 +288,41 @@ export default {
|
|
|
// label: "自建仓",
|
|
|
// },
|
|
|
{
|
|
|
- value: "5",
|
|
|
- label: "销售仓",
|
|
|
+ value: '5',
|
|
|
+ label: '销售仓'
|
|
|
},
|
|
|
{
|
|
|
- value: "4",
|
|
|
- label: "次品仓",
|
|
|
- },
|
|
|
+ value: '4',
|
|
|
+ label: '次品仓'
|
|
|
+ }
|
|
|
],
|
|
|
ruleForm: {
|
|
|
- companyNo: "",
|
|
|
- name: "", // 仓库名称
|
|
|
+ companyNo: '',
|
|
|
+ name: '', // 仓库名称
|
|
|
// supplierNo: [], //供应商编码
|
|
|
- wsmtype: "", //仓库类型 目前随便填
|
|
|
- addr_code: [], //仓库省市区
|
|
|
- addr: "", //仓库详细地址
|
|
|
- contactor_id: [], //仓库联系人
|
|
|
- mobile: "", //仓库联系方式
|
|
|
- position: "", //联系人职位 目前随便填
|
|
|
+ wsmtype: '', // 仓库类型 目前随便填
|
|
|
+ addr_code: [], // 仓库省市区
|
|
|
+ addr: '', // 仓库详细地址
|
|
|
+ contactor_id: [], // 仓库联系人
|
|
|
+ mobile: '', // 仓库联系方式
|
|
|
+ position: '', // 联系人职位 目前随便填
|
|
|
|
|
|
- wsm_name: "", //收发货联系人
|
|
|
- wsm_mobile: "", //收发货联系方式
|
|
|
- wsm_addr: "", //收发货地址详细
|
|
|
- addrs_code: [], //收发货省市区
|
|
|
+ wsm_name: '', // 收发货联系人
|
|
|
+ wsm_mobile: '', // 收发货联系方式
|
|
|
+ wsm_addr: '', // 收发货地址详细
|
|
|
+ addrs_code: [] // 收发货省市区
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
- name: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
|
|
|
- position: [{ required: true, message: "联系人职位不能为空", trigger: "blur" }],
|
|
|
- wsmtype: [{ required: true, message: "请选择仓库类型", trigger: "change" }],
|
|
|
+ name: [{ required: true, message: '仓库名称不能为空', trigger: 'blur' }],
|
|
|
+ position: [{ required: true, message: '联系人职位不能为空', trigger: 'blur' }],
|
|
|
+ wsmtype: [{ required: true, message: '请选择仓库类型', trigger: 'change' }],
|
|
|
companyNo: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "业务公司不能为空",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
+ message: '业务公司不能为空',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
],
|
|
|
// supplierNo: [
|
|
|
// {
|
|
@@ -344,136 +334,136 @@ export default {
|
|
|
// ],
|
|
|
addr_code: [
|
|
|
{
|
|
|
- type: "array",
|
|
|
+ type: 'array',
|
|
|
required: true,
|
|
|
- message: "仓库所在省/市/区",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
+ message: '仓库所在省/市/区',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
],
|
|
|
- addr: [{ required: true, validator: validateAddr, trigger: "blur" }],
|
|
|
+ addr: [{ required: true, validator: validateAddr, trigger: 'blur' }],
|
|
|
|
|
|
contactor_id: [
|
|
|
{
|
|
|
required: true,
|
|
|
- type: "array",
|
|
|
- message: "仓库负责人",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
+ type: 'array',
|
|
|
+ message: '仓库负责人',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
],
|
|
|
|
|
|
mobile: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validatemobile,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
wsm_name: [
|
|
|
- { required: true, message: "收发货联系人", trigger: "blur" },
|
|
|
+ { required: true, message: '收发货联系人', trigger: 'blur' },
|
|
|
{
|
|
|
min: 1,
|
|
|
max: 20,
|
|
|
- message: "长度在 1 到 20 个字符",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ message: '长度在 1 到 20 个字符',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
wsm_mobile: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validatewsmmobile,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
addrs_code: [
|
|
|
{
|
|
|
- type: "array",
|
|
|
+ type: 'array',
|
|
|
required: true,
|
|
|
- message: "收发货所在省/市/区",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
+ message: '收发货所在省/市/区',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
],
|
|
|
wsm_addr: [
|
|
|
- { required: true, message: "收发货详细地址", trigger: "blur" },
|
|
|
+ { required: true, message: '收发货详细地址', trigger: 'blur' },
|
|
|
{
|
|
|
min: 1,
|
|
|
max: 100,
|
|
|
- message: "长度在 1 到 100 个字符",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- };
|
|
|
+ message: '长度在 1 到 100 个字符',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
- showModel: function (val) {
|
|
|
- this.showModelThis = val;
|
|
|
+ showModel: function(val) {
|
|
|
+ this.showModelThis = val
|
|
|
if (val) {
|
|
|
- this.initForm();
|
|
|
+ this.initForm()
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
|
if (!val) {
|
|
|
- this.$emit("cancel");
|
|
|
+ this.$emit('cancel')
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- //业务公司选择
|
|
|
+ // 业务公司选择
|
|
|
async companyNosearchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- this.ruleForm.companyNo = code || "";
|
|
|
- this.$refs.ruleForm.validateField("companyNo");
|
|
|
+ const { id, code, label } = e
|
|
|
+ this.ruleForm.companyNo = code || ''
|
|
|
+ this.$refs.ruleForm.validateField('companyNo')
|
|
|
},
|
|
|
- //供应商公司选择
|
|
|
+ // 供应商公司选择
|
|
|
supplierChange(e) {
|
|
|
if (e && e.id) {
|
|
|
- this.ruleForm.supplierNo = [e.code]; //供应商编码
|
|
|
+ this.ruleForm.supplierNo = [e.code] // 供应商编码
|
|
|
} else {
|
|
|
- this.ruleForm.supplierNo = [];
|
|
|
+ this.ruleForm.supplierNo = []
|
|
|
}
|
|
|
- this.$refs.ruleForm.validateField("supplierNo");
|
|
|
+ this.$refs.ruleForm.validateField('supplierNo')
|
|
|
},
|
|
|
- //仓库省市区
|
|
|
+ // 仓库省市区
|
|
|
selectAreaAddr_code(e) {
|
|
|
- this.ruleForm.addr_code = e;
|
|
|
- this.$refs.ruleForm.validateField("addr_code");
|
|
|
+ this.ruleForm.addr_code = e
|
|
|
+ this.$refs.ruleForm.validateField('addr_code')
|
|
|
},
|
|
|
- //收发货省市区
|
|
|
+ // 收发货省市区
|
|
|
selectAreaAddrs_code(e) {
|
|
|
- this.ruleForm.addrs_code = e;
|
|
|
- this.$refs.ruleForm.validateField("addrs_code");
|
|
|
+ this.ruleForm.addrs_code = e
|
|
|
+ this.$refs.ruleForm.validateField('addrs_code')
|
|
|
},
|
|
|
- //负责人选择
|
|
|
+ // 负责人选择
|
|
|
accountChange(e) {
|
|
|
if (e && e.id) {
|
|
|
- this.ruleForm.contactor_id = [e.id];
|
|
|
+ this.ruleForm.contactor_id = [e.id]
|
|
|
} else {
|
|
|
- this.ruleForm.contactor_id = [];
|
|
|
+ this.ruleForm.contactor_id = []
|
|
|
}
|
|
|
- this.$refs.ruleForm.validateField("contactor_id");
|
|
|
+ this.$refs.ruleForm.validateField('contactor_id')
|
|
|
},
|
|
|
async initForm() {
|
|
|
- this.supplier_name = "";
|
|
|
- this.loading = true;
|
|
|
- if (this.id === "add") {
|
|
|
- this.title = "新建仓库";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
+ this.supplier_name = ''
|
|
|
+ this.loading = true
|
|
|
+ if (this.id === 'add') {
|
|
|
+ this.title = '新建仓库'
|
|
|
+ this.rulesThis = this.rules
|
|
|
+ await this.resetForm()
|
|
|
} else {
|
|
|
if (this.isDetail) {
|
|
|
- this.title = "仓库详情";
|
|
|
- this.rulesThis = {};
|
|
|
+ this.title = '仓库详情'
|
|
|
+ this.rulesThis = {}
|
|
|
} else {
|
|
|
- this.title = "修改仓库";
|
|
|
- this.rulesThis = this.rules;
|
|
|
+ this.title = '修改仓库'
|
|
|
+ this.rulesThis = this.rules
|
|
|
}
|
|
|
- await this.resetForm();
|
|
|
- await this.initData();
|
|
|
+ await this.resetForm()
|
|
|
+ await this.initData()
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
async initData() {
|
|
|
- const res = await asyncRequest.detail({ id: this.id });
|
|
|
+ const res = await asyncRequest.detail({ id: this.id })
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
const {
|
|
|
addr,
|
|
@@ -491,92 +481,92 @@ export default {
|
|
|
wsm_name,
|
|
|
companyNo,
|
|
|
position,
|
|
|
- wsm_type,
|
|
|
- } = res.data;
|
|
|
+ wsm_type
|
|
|
+ } = res.data
|
|
|
|
|
|
- this.supplier_name = supplier_name;
|
|
|
- this.accountNames = contactor_name;
|
|
|
+ this.supplier_name = supplier_name
|
|
|
+ this.accountNames = contactor_name
|
|
|
this.ruleForm = {
|
|
|
- companyNo: companyNo || this.business_companyNo || "",
|
|
|
+ companyNo: companyNo || this.business_companyNo || '',
|
|
|
name: name, // 仓库名称
|
|
|
// supplierNo: [supplierNo], //供应商编码
|
|
|
- wsmtype: wsm_type || "", //仓库类型 目前随便填
|
|
|
- addr_code: this.getCode(addr_code), //仓库省市区
|
|
|
- addr: addr, //仓库详细地址
|
|
|
- contactor_id: contactor ? [contactor] : [], //仓库联系人
|
|
|
- mobile: mobile, //仓库联系方式
|
|
|
- position: position || "", //联系人职位 目前随便填
|
|
|
- wsm_type: "", //目前随便填
|
|
|
+ wsmtype: wsm_type || '', // 仓库类型 目前随便填
|
|
|
+ addr_code: this.getCode(addr_code), // 仓库省市区
|
|
|
+ addr: addr, // 仓库详细地址
|
|
|
+ contactor_id: contactor ? [contactor] : [], // 仓库联系人
|
|
|
+ mobile: mobile, // 仓库联系方式
|
|
|
+ position: position || '', // 联系人职位 目前随便填
|
|
|
+ wsm_type: '', // 目前随便填
|
|
|
|
|
|
- wsm_name: wsm_name, //收发货联系人
|
|
|
- wsm_mobile: wsm_mobile, //收发货联系方式
|
|
|
- wsm_addr: wsm_addr, //收发货地址详细
|
|
|
- addrs_code: this.getCode(addrs_code), //收发货省市区
|
|
|
- };
|
|
|
- console.log(this.ruleForm);
|
|
|
+ wsm_name: wsm_name, // 收发货联系人
|
|
|
+ wsm_mobile: wsm_mobile, // 收发货联系方式
|
|
|
+ wsm_addr: wsm_addr, // 收发货地址详细
|
|
|
+ addrs_code: this.getCode(addrs_code) // 收发货省市区
|
|
|
+ }
|
|
|
+ console.log(this.ruleForm)
|
|
|
|
|
|
// this.ruleForm = res.data;
|
|
|
// this.ruleForm.role_id = this.ruleForm.role;
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
|
},
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
- this.$refs.ruleForm.resetFields();
|
|
|
- this.$refs.ruleForm.clearValidate();
|
|
|
- this.supplier_name = "";
|
|
|
- this.accountNames = "";
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
+ this.$refs.ruleForm.clearValidate()
|
|
|
+ this.supplier_name = ''
|
|
|
+ this.accountNames = ''
|
|
|
this.ruleForm = {
|
|
|
- companyNo: "",
|
|
|
- name: "", // 仓库名称
|
|
|
+ companyNo: '',
|
|
|
+ name: '', // 仓库名称
|
|
|
// supplierNo: [], //供应商编码
|
|
|
- wsmtype: "", //仓库类型 目前随便填
|
|
|
- addr_code: [], //仓库省市区
|
|
|
- addr: "", //仓库详细地址
|
|
|
- contactor_id: [], //仓库联系人
|
|
|
- mobile: "", //仓库联系方式
|
|
|
- position: "", //联系人职位 目前随便填
|
|
|
+ wsmtype: '', // 仓库类型 目前随便填
|
|
|
+ addr_code: [], // 仓库省市区
|
|
|
+ addr: '', // 仓库详细地址
|
|
|
+ contactor_id: [], // 仓库联系人
|
|
|
+ mobile: '', // 仓库联系方式
|
|
|
+ position: '', // 联系人职位 目前随便填
|
|
|
// wsm_type: "", //目前随便填
|
|
|
|
|
|
- wsm_name: "", //收发货联系人
|
|
|
- wsm_mobile: "", //收发货联系方式
|
|
|
- wsm_addr: "", //收发货地址详细
|
|
|
- addrs_code: [], //收发货省市区
|
|
|
- };
|
|
|
+ wsm_name: '', // 收发货联系人
|
|
|
+ wsm_mobile: '', // 收发货联系方式
|
|
|
+ wsm_addr: '', // 收发货地址详细
|
|
|
+ addrs_code: [] // 收发货省市区
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
setCode(list) {
|
|
|
- let model = {
|
|
|
+ const model = {
|
|
|
provice_code: list[0],
|
|
|
city_code: list[1],
|
|
|
- area_code: list[2],
|
|
|
- };
|
|
|
- return model;
|
|
|
+ area_code: list[2]
|
|
|
+ }
|
|
|
+ return model
|
|
|
},
|
|
|
getCode(obj) {
|
|
|
- let arr = [];
|
|
|
- arr.push(obj.provice_code);
|
|
|
- arr.push(obj.city_code);
|
|
|
- arr.push(obj.area_code);
|
|
|
- return arr;
|
|
|
+ const arr = []
|
|
|
+ arr.push(obj.provice_code)
|
|
|
+ arr.push(obj.city_code)
|
|
|
+ arr.push(obj.area_code)
|
|
|
+ return arr
|
|
|
},
|
|
|
getId(list) {
|
|
|
- let arr = JSON.parse(JSON.stringify(list));
|
|
|
- return arr.join(",");
|
|
|
+ const arr = JSON.parse(JSON.stringify(list))
|
|
|
+ return arr.join(',')
|
|
|
},
|
|
|
async submitForm() {
|
|
|
- await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ await this.$refs.ruleForm.validate(async(valid) => {
|
|
|
if (valid) {
|
|
|
if (this.loading) {
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
const {
|
|
|
name,
|
|
|
// supplierNo,
|
|
@@ -590,8 +580,8 @@ export default {
|
|
|
addrs_code,
|
|
|
companyNo,
|
|
|
position,
|
|
|
- wsmtype,
|
|
|
- } = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ wsmtype
|
|
|
+ } = JSON.parse(JSON.stringify(this.ruleForm))
|
|
|
const model = {
|
|
|
id: this.id,
|
|
|
companyNo,
|
|
@@ -607,39 +597,39 @@ export default {
|
|
|
addrs_code: this.setCode(addrs_code),
|
|
|
position,
|
|
|
// wsm_type: "", //目前随便填
|
|
|
- wsmtype,
|
|
|
- };
|
|
|
- console.log(model);
|
|
|
- let res = {};
|
|
|
- if (this.id === "add") {
|
|
|
- delete model["id"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
+ wsmtype
|
|
|
+ }
|
|
|
+ console.log(model)
|
|
|
+ let res = {}
|
|
|
+ if (this.id === 'add') {
|
|
|
+ delete model['id']
|
|
|
+ res = await asyncRequest.add(model)
|
|
|
} else {
|
|
|
- res = await asyncRequest.update(model);
|
|
|
+ res = await asyncRequest.update(model)
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
+ this.loading = false
|
|
|
if (res && res.code === 0) {
|
|
|
- const title = this.id === "add" ? "添加成功" : "修改成功";
|
|
|
+ const title = this.id === 'add' ? '添加成功' : '修改成功'
|
|
|
this.$notify.success({
|
|
|
title,
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.showModelThis = false;
|
|
|
+ message: ''
|
|
|
+ })
|
|
|
+ this.showModelThis = false
|
|
|
// 刷新
|
|
|
- this.$emit("refresh");
|
|
|
+ this.$emit('refresh')
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
|
} else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|