|
|
@ -1,15 +1,14 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="app-container"> |
|
|
|
<!--标题按钮部分开始--> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<!--标题--> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<!--start 添加修改按钮--> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" |
|
|
|
@click="dialogStatus === 'add' ? saveAdd() : saveEdit()">保存 |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="dialogStatus === 'add' ? saveAdd() : saveEdit()">保存 |
|
|
|
</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">返回</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
<!--end 添加修改按钮--> |
|
|
|
<!--end 详情按钮--> |
|
|
@ -18,26 +17,26 @@ |
|
|
|
<!--Start 新增修改部分--> |
|
|
|
<div class="listconadd"> |
|
|
|
<div class="titwu"><span>存放地点</span></div> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="top" label-width="300px" class="formadd"> |
|
|
|
<!-- <el-row>--> |
|
|
|
<!-- <el-col :span="18" class="specialCol">--> |
|
|
|
<!-- <span>使用组织:</span>--> |
|
|
|
<!-- <span>{{ formobj.useOrg }}</span>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
<!-- </el-row>--> |
|
|
|
<el-row> |
|
|
|
<el-col :span="3" class="tleftb row_first"> |
|
|
|
<el-form-item><span slot="label"><span class="icon">*</span>使用组织</span></el-form-item> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|
|
|
<!-- <el-row>--> |
|
|
|
<!-- <el-col :span="18" class="specialCol">--> |
|
|
|
<!-- <span>使用组织:</span>--> |
|
|
|
<!-- <span>{{ formobj.useOrg }}</span>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
<!-- </el-row>--> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>使用组织</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9" class="trightb row_first"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-input v-model="formobj.useOrg" placeholder="使用组织" class="addinputw" :disabled="true"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb row_first"> |
|
|
|
<el-form-item><span slot="label"><span class="icon">*</span>名称</span></el-form-item> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>名称</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9" class="trightb row_first"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop="warehouseName"> |
|
|
|
<el-input v-model="formobj.warehouseName" placeholder="名称" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
@ -45,35 +44,43 @@ |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-form-item><span slot="label"><span class="icon">*</span>负责人及电话</span></el-form-item> |
|
|
|
<span><span class="icon">*</span>负责人及电话</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9" class="trightb"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop="warehouseContract"> |
|
|
|
<el-input v-model="formobj.warehouseContract" placeholder="负责人及电话" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-form-item><span slot="label"><span class="icon">*</span>分组</span></el-form-item> |
|
|
|
<span><span class="icon">*</span>分组</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9" class="trightb"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop="warehouseGroupKey"> |
|
|
|
<el-select v-model="formobj.warehouseGroupKey" placeholder="请选择" @change="changeWarehouseGroup" clearable |
|
|
|
class="addinputw"> |
|
|
|
<el-select v-model="formobj.warehouseGroupKey" placeholder="请选择" @change="changeWarehouseGroup" clearable class="addinputw"> |
|
|
|
<el-option v-for="item in warehouseGroup_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
<!-- <el-input v-model="formobj.warehouseGroup" placeholder="分组" class="addinputw" clearable/>--> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<el-form-item><span slot="label"><span class="icon">*</span>详细地址</span></el-form-item> |
|
|
|
<span><span class="icon">*</span>详细地址</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="21" class="trightb"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop="warehouseAttribute"> |
|
|
|
<el-input v-model="formobj.warehouseAttribute" placeholder="详细地址" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>库管人员</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item prop="libTubeName"> |
|
|
|
<el-select v-model="formobj.libTubeName" placeholder="请选择" @change="changeLibTube" clearable class="addinputw"> |
|
|
|
<el-option v-for="item in libTube_list" :key="item.userSid" :label="item.userName" :value="item.userName"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
@ -84,7 +91,7 @@ |
|
|
|
<script> |
|
|
|
import req from '@/api/anruiscm/scmwarehouse' |
|
|
|
import { getUseOrgByUserSid } from '@/api/cheliang/basevehicle' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
import { typeValues, getGressionUserList } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'ScmWarehouseAdd', |
|
|
@ -97,7 +104,7 @@ export default { |
|
|
|
dataArr: [], |
|
|
|
refreshItem: 0, // 级联列表key值 |
|
|
|
options: [], // 级联列表选项 |
|
|
|
props: { // props传值 |
|
|
|
props: { |
|
|
|
value: 'sid', |
|
|
|
label: 'name', |
|
|
|
children: 'children', |
|
|
@ -107,310 +114,291 @@ export default { |
|
|
|
orgProps: { |
|
|
|
value: 'sid', |
|
|
|
label: 'name', |
|
|
|
children: 'children', |
|
|
|
checkStrictly: true |
|
|
|
}, |
|
|
|
orgOptions: [], |
|
|
|
orgArr: [], |
|
|
|
warehouseGroup_list:[], |
|
|
|
formobj: { |
|
|
|
id: '', |
|
|
|
sid: '', |
|
|
|
useOrg: '', // 使用组织 |
|
|
|
useOrgSid: '', // 使用组织sid |
|
|
|
// warehouseCode: '', // 编码 |
|
|
|
warehouseName: '', // 名称 |
|
|
|
warehouseAttribute: '', // 存放地点属性 |
|
|
|
warehouseContract: '', // 存放地点负责人 |
|
|
|
warehouseContractSid: '', // 存放地点负责人sid |
|
|
|
warehouseGroupValue:'', |
|
|
|
warehouseGroupKey:'' |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
useOrg: [{ required: true, message: '使用组织不能为空', trigger: 'change' }], // 使用组织 |
|
|
|
useOrgSid: [{ required: true, message: '使用组织sid不能为空', trigger: 'blur' }], // 使用组织sid |
|
|
|
// warehouseCode: [{ required: true, message: '编码不能为空', trigger: 'blur' }], // 编码 |
|
|
|
warehouseName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], // 名称 |
|
|
|
warehouseAttribute: [{ required: true, message: '存放地点详细地址不能为空', trigger: 'blur' }], // 存放地点属性 |
|
|
|
warehouseContract: [{ required: true, message: '存放地点负责人不能为空', trigger: 'blur' }], // 存放地点负责人 |
|
|
|
warehouseContractSid: [{ required: true, message: '存放地点负责人sid不能为空', trigger: 'blur' }], // 存放地点负责人sid |
|
|
|
warehouseGroupKey: [{ required: true, message: '分组不能为空', trigger: 'blur' }] // 分组 |
|
|
|
}, |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getBuMen() |
|
|
|
this.getOrg() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 分公司 |
|
|
|
getUseOrg() { |
|
|
|
const userSid = window.sessionStorage.getItem('userSid') |
|
|
|
getUseOrgByUserSid({ userSid: userSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.useOrg = res.data.name // 使用组织 |
|
|
|
this.formobj.useOrgSid = res.data.sid // 使用组织sid |
|
|
|
} |
|
|
|
}) |
|
|
|
children: 'children', |
|
|
|
checkStrictly: true |
|
|
|
}, |
|
|
|
// 组织(单选) |
|
|
|
getOrg() { |
|
|
|
req.getOrg().then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.useOrg_list = res.data |
|
|
|
console.log('使用组织', this.useOrg_list) |
|
|
|
} |
|
|
|
}) |
|
|
|
orgOptions: [], |
|
|
|
orgArr: [], |
|
|
|
warehouseGroup_list: [], |
|
|
|
libTube_list: [], |
|
|
|
formobj: { |
|
|
|
id: '', |
|
|
|
sid: '', |
|
|
|
useOrg: '', // 使用组织 |
|
|
|
useOrgSid: '', // 使用组织sid |
|
|
|
// warehouseCode: '', // 编码 |
|
|
|
warehouseName: '', // 名称 |
|
|
|
warehouseAttribute: '', // 存放地点属性 |
|
|
|
warehouseContract: '', // 存放地点负责人 |
|
|
|
warehouseContractSid: '', // 存放地点负责人sid |
|
|
|
warehouseGroupValue: '', |
|
|
|
warehouseGroupKey: '', |
|
|
|
libTubeName: '', |
|
|
|
libTubeSid: '' |
|
|
|
}, |
|
|
|
|
|
|
|
useOrgChange(value) { |
|
|
|
console.log('触发下拉框按钮', value) |
|
|
|
let bb = {} |
|
|
|
this.useOrg_list.forEach((e) => { |
|
|
|
// eslint-disable-next-line eqeqeq |
|
|
|
if (e.name == value) { |
|
|
|
bb = { |
|
|
|
name: e.name, |
|
|
|
key: e.id, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formobj.useOrg = bb.name |
|
|
|
this.formobj.useOrgSid = bb.sid |
|
|
|
console.log('name', this.formobj.useOrg, this.formobj.useOrgSid) |
|
|
|
rules: { |
|
|
|
useOrg: [{ required: true, message: '使用组织不能为空', trigger: 'change' }], // 使用组织 |
|
|
|
useOrgSid: [{ required: true, message: '使用组织sid不能为空', trigger: 'blur' }], // 使用组织sid |
|
|
|
// warehouseCode: [{ required: true, message: '编码不能为空', trigger: 'blur' }], // 编码 |
|
|
|
warehouseName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], // 名称 |
|
|
|
warehouseAttribute: [{ required: true, message: '存放地点详细地址不能为空', trigger: 'blur' }], // 存放地点属性 |
|
|
|
warehouseContract: [{ required: true, message: '存放地点负责人不能为空', trigger: 'blur' }], // 存放地点负责人 |
|
|
|
warehouseContractSid: [{ required: true, message: '存放地点负责人sid不能为空', trigger: 'blur' }], // 存放地点负责人sid |
|
|
|
warehouseGroupKey: [{ required: true, message: '分组不能为空', trigger: 'change' }], // 分组 |
|
|
|
libTubeName: [{ required: true, message: '库管人员不能为空', trigger: 'change' }] |
|
|
|
}, |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getBuMen() |
|
|
|
this.getOrg() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 分公司 |
|
|
|
getUseOrg() { |
|
|
|
const userSid = window.sessionStorage.getItem('userSid') |
|
|
|
getUseOrgByUserSid({ userSid: userSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.useOrg = res.data.name // 使用组织 |
|
|
|
this.formobj.useOrgSid = res.data.sid // 使用组织sid |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 组织(单选) |
|
|
|
getOrg() { |
|
|
|
req.getOrg().then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.useOrg_list = res.data |
|
|
|
console.log('使用组织', this.useOrg_list) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// org0(data) { |
|
|
|
// data.forEach((e) => { |
|
|
|
// if (e.children.length != 0) { |
|
|
|
// this.org0(e.children) |
|
|
|
// } else { |
|
|
|
// delete e.children |
|
|
|
// this.orgArr.push(e) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
//级联列表-组织 |
|
|
|
getBuMen() { |
|
|
|
req.salesDepName().then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.options = res.data |
|
|
|
console.log('请求到的级联列表', this.options) |
|
|
|
this.BuMen0(this.options) |
|
|
|
useOrgChange(value) { |
|
|
|
console.log('触发下拉框按钮', value) |
|
|
|
let bb = null |
|
|
|
this.useOrg_list.forEach((e) => { |
|
|
|
// eslint-disable-next-line eqeqeq |
|
|
|
if (e.name === value) { |
|
|
|
bb = { |
|
|
|
name: e.name, |
|
|
|
key: e.id, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
BuMen0(data) { |
|
|
|
data.forEach((e) => { |
|
|
|
if (e.children){ |
|
|
|
if (e.children.length != 0) { |
|
|
|
this.BuMen0(e.children) |
|
|
|
} else { |
|
|
|
delete e.children |
|
|
|
this.dataArr.push(e) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formobj.useOrg = bb.name |
|
|
|
this.formobj.useOrgSid = bb.sid |
|
|
|
console.log('name', this.formobj.useOrg, this.formobj.useOrgSid) |
|
|
|
}, |
|
|
|
|
|
|
|
// org0(data) { |
|
|
|
// data.forEach((e) => { |
|
|
|
// if (e.children.length != 0) { |
|
|
|
// this.org0(e.children) |
|
|
|
// } else { |
|
|
|
// delete e.children |
|
|
|
// this.orgArr.push(e) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 级联列表-组织 |
|
|
|
getBuMen() { |
|
|
|
req.salesDepName().then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.options = res.data |
|
|
|
console.log('请求到的级联列表', this.options) |
|
|
|
this.BuMen0(this.options) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
BuMen0(data) { |
|
|
|
data.forEach((e) => { |
|
|
|
if (e.children) { |
|
|
|
if (e.children.length != 0) { |
|
|
|
this.BuMen0(e.children) |
|
|
|
} else { |
|
|
|
delete e.children |
|
|
|
this.dataArr.push(e) |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getType(){ |
|
|
|
typeValues({type:'locationGroup'}).then((res) => { |
|
|
|
if (res.success){ |
|
|
|
this.warehouseGroup_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getType() { |
|
|
|
typeValues({ type: 'locationGroup' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseGroup_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getGressionUserList(window.sessionStorage.getItem('userSid')).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.libTube_list = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeWarehouseGroup(val) { |
|
|
|
if (val) { |
|
|
|
const choosetItem = this.warehouseGroup_list.filter((item) => item.dictKey === val) |
|
|
|
this.formobj.warehouseGroupValue = choosetItem[0].dictValue |
|
|
|
console.log('name:', this.formobj.warehouseGroupValue, 'key:', this.formobj.warehouseGroupKey) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeLibTube(value) { |
|
|
|
let bb = null |
|
|
|
this.libTube_list.forEach((e) => { |
|
|
|
if (e.userName === value) { |
|
|
|
bb = { |
|
|
|
name: e.userName, |
|
|
|
sid: e.userSid |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeWarehouseGroup(val){ |
|
|
|
if (val) { |
|
|
|
const choosetItem = this.warehouseGroup_list.filter((item) => item.dictKey == val) |
|
|
|
this.formobj.warehouseGroupValue = choosetItem[0].dictValue |
|
|
|
console.log('name:', this.formobj.warehouseGroupValue, 'key:', this.formobj.warehouseGroupKey) |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
this.formobj.libTubeSid = bb.sid |
|
|
|
}, |
|
|
|
|
|
|
|
// //库存组织 |
|
|
|
// useOrgChange(e) { |
|
|
|
// console.log('选中结果:' + JSON.stringify(e)) |
|
|
|
// var result = '' |
|
|
|
// var result_Sid = '' |
|
|
|
// if (e.length > 0) { |
|
|
|
// // 循环多选项 |
|
|
|
// e.forEach((item) => { |
|
|
|
// var last_id = item[item.length - 1] |
|
|
|
// // 循环查找名字 |
|
|
|
// this.select_temp_Name = '' // 临时遍历,用来保存选中结果(组织名称) |
|
|
|
// this.select_temp_Sid = '' //临时遍历,用来保存选中结果(组织Sid) |
|
|
|
// this.gainOrgId(last_id, this.orgOptions) |
|
|
|
// result = result + this.select_temp_Name + ',' |
|
|
|
// result_Sid = result_Sid + this.select_temp_Sid + ',' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// if (result !== '') { |
|
|
|
// result = result.substring(0, result.length - 1) |
|
|
|
// } |
|
|
|
// if (result_Sid !== '') { |
|
|
|
// result_Sid = result_Sid.substring(0, result_Sid.length - 1) |
|
|
|
// } |
|
|
|
// this.formobj.useOrg = result |
|
|
|
// this.formobj.useOrgSid = result_Sid |
|
|
|
// console.log('选中名称:' + this.formobj.useOrg, this.formobj.useOrgSid) |
|
|
|
// }, |
|
|
|
// |
|
|
|
// // --- 循环查询 |
|
|
|
// gainOrgId(id, orgOptions) { |
|
|
|
// console.log('这里是组织id', id) |
|
|
|
// for (var i = 0; i < orgOptions.length; i++) { |
|
|
|
// if (id == orgOptions[i].sid) { |
|
|
|
// this.select_temp_Name = orgOptions[i].name // 保存找到的内容 |
|
|
|
// this.select_temp_Sid = orgOptions[i].sid |
|
|
|
// return true |
|
|
|
// } else { |
|
|
|
// // 判断是否最后一级 |
|
|
|
// if (orgOptions[i].children !== undefined) { |
|
|
|
// // 不是的话查询下一级 |
|
|
|
// if (this.gainOrgId(id, orgOptions[i].children)) { |
|
|
|
// return true |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// //库存组织 |
|
|
|
// useOrgChange(e) { |
|
|
|
// console.log('选中结果:' + JSON.stringify(e)) |
|
|
|
// var result = '' |
|
|
|
// var result_Sid = '' |
|
|
|
// if (e.length > 0) { |
|
|
|
// // 循环多选项 |
|
|
|
// e.forEach((item) => { |
|
|
|
// var last_id = item[item.length - 1] |
|
|
|
// // 循环查找名字 |
|
|
|
// this.select_temp_Name = '' // 临时遍历,用来保存选中结果(组织名称) |
|
|
|
// this.select_temp_Sid = '' //临时遍历,用来保存选中结果(组织Sid) |
|
|
|
// this.gainOrgId(last_id, this.orgOptions) |
|
|
|
// result = result + this.select_temp_Name + ',' |
|
|
|
// result_Sid = result_Sid + this.select_temp_Sid + ',' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// if (result !== '') { |
|
|
|
// result = result.substring(0, result.length - 1) |
|
|
|
// } |
|
|
|
// if (result_Sid !== '') { |
|
|
|
// result_Sid = result_Sid.substring(0, result_Sid.length - 1) |
|
|
|
// } |
|
|
|
// this.formobj.useOrg = result |
|
|
|
// this.formobj.useOrgSid = result_Sid |
|
|
|
// console.log('选中名称:' + this.formobj.useOrg, this.formobj.useOrgSid) |
|
|
|
// }, |
|
|
|
// |
|
|
|
// // --- 循环查询 |
|
|
|
// gainOrgId(id, orgOptions) { |
|
|
|
// console.log('这里是组织id', id) |
|
|
|
// for (var i = 0; i < orgOptions.length; i++) { |
|
|
|
// if (id == orgOptions[i].sid) { |
|
|
|
// this.select_temp_Name = orgOptions[i].name // 保存找到的内容 |
|
|
|
// this.select_temp_Sid = orgOptions[i].sid |
|
|
|
// return true |
|
|
|
// } else { |
|
|
|
// // 判断是否最后一级 |
|
|
|
// if (orgOptions[i].children !== undefined) { |
|
|
|
// // 不是的话查询下一级 |
|
|
|
// if (this.gainOrgId(id, orgOptions[i].children)) { |
|
|
|
// return true |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj.id = '' |
|
|
|
this.formobj.sid = '' // SID |
|
|
|
this.useOrg = '' // 使用组织 |
|
|
|
this.useOrgSid = '' // 使用组织sid |
|
|
|
// this.warehouseCode = '' // 编码 |
|
|
|
this.warehouseName = '' // 名称 |
|
|
|
this.warehouseAttribute = '' // 存放地点属性 |
|
|
|
this.warehouseContract = '' // 存放地点负责人 |
|
|
|
this.warehouseContractSid = '' // 存放地点负责人sid |
|
|
|
this.warehouseGroup = '' // 分组 |
|
|
|
// this.useOrg_list = [] |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】存放地点' |
|
|
|
this.getUseOrg() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【修改】存放地点' |
|
|
|
const _this = this |
|
|
|
req |
|
|
|
.fetchBySid(row.sid) |
|
|
|
.then(resp => { |
|
|
|
const vdata = resp.data |
|
|
|
_this.formobj.id = vdata.id |
|
|
|
_this.formobj.sid = vdata.sid // SID |
|
|
|
_this.formobj.useOrg = vdata.useOrg // 使用组织 |
|
|
|
// _this.formobj.warehouseCode = vdata.warehouseCode // 编码 |
|
|
|
_this.formobj.warehouseName = vdata.warehouseName // 名称 |
|
|
|
_this.formobj.warehouseAttribute = vdata.warehouseAttribute // 存放地点属性 |
|
|
|
_this.formobj.warehouseContract = vdata.warehouseContract // 存放地点负责人 |
|
|
|
_this.formobj.warehouseContractSid = vdata.warehouseContractSid // 存放地点负责人sid |
|
|
|
_this.formobj.warehouseGroupKey = vdata.warehouseGroupKey // 分组 |
|
|
|
_this.formobj.warehouseGroupValue = vdata.warehouseGroupValue // 分组 |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj.id = '' |
|
|
|
this.formobj.sid = '' // SID |
|
|
|
this.formobj.useOrg = '' // 使用组织 |
|
|
|
this.useOrgSid = '' // 使用组织sid |
|
|
|
// this.warehouseCode = '' // 编码 |
|
|
|
this.formobj.warehouseName = '' // 名称 |
|
|
|
this.formobj.warehouseAttribute = '' // 存放地点属性 |
|
|
|
this.formobj.warehouseContract = '' // 存放地点负责人 |
|
|
|
this.formobj.warehouseContractSid = '' // 存放地点负责人sid |
|
|
|
this.formobj.warehouseGroup = '' // 分组 |
|
|
|
this.formobj.libTubeSid = '' |
|
|
|
this.formobj.libTubeName = '' |
|
|
|
// this.useOrg_list = [] |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】存放地点' |
|
|
|
this.getUseOrg() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【修改】存放地点' |
|
|
|
req.fetchBySid(row.sid).then(resp => { |
|
|
|
const vdata = resp.data |
|
|
|
this.formobj.id = vdata.id |
|
|
|
this.formobj.sid = vdata.sid // SID |
|
|
|
this.formobj.useOrg = vdata.useOrg // 使用组织 |
|
|
|
// this.formobj.warehouseCode = vdata.warehouseCode // 编码 |
|
|
|
this.formobj.warehouseName = vdata.warehouseName // 名称 |
|
|
|
this.formobj.warehouseAttribute = vdata.warehouseAttribute // 存放地点属性 |
|
|
|
this.formobj.warehouseContract = vdata.warehouseContract // 存放地点负责人 |
|
|
|
this.formobj.warehouseContractSid = vdata.warehouseContractSid // 存放地点负责人sid |
|
|
|
this.formobj.warehouseGroupKey = vdata.warehouseGroupKey // 分组 |
|
|
|
this.formobj.warehouseGroupValue = vdata.warehouseGroupValue // 分组 |
|
|
|
this.formobj.libTubeName = vdata.libTubeName |
|
|
|
this.formobj.libTubeSid = vdata.libTubeSid |
|
|
|
}).catch(e => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
|
this.getUseOrg() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
saveAdd() { |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveAdd(this.formobj).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
|
this.formobj = row |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveEdit() { |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveEdit(this.formobj, this.formobj.sid).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
this.getUseOrg() |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
saveAdd() { |
|
|
|
const _this = this |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req |
|
|
|
.saveAdd(this.formobj) |
|
|
|
.then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
_this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
_this.handleReturn('true') |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveEdit() { |
|
|
|
const _this = this |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req |
|
|
|
.saveEdit(this.formobj, this.formobj.sid) |
|
|
|
.then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
_this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
_this.handleReturn('true') |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
/deep/ .el-form-item__label { |
|
|
|
padding: 0 !important; |
|
|
|
} |
|
|
|
|
|
|
|
.row_first { |
|
|
|
border-top: 1px solid #e0e3eb !important; |
|
|
|
} |
|
|
|
|
|
|
|
/*.formadd /deep/ .el-row {*/ |
|
|
|
/* display: -webkit-box;*/ |
|
|
|
/* display: -ms-flexbox;*/ |
|
|
|
/* display: flex;*/ |
|
|
|
/* -ms-flex-wrap: wrap;*/ |
|
|
|
/* justify-content: center;*/ |
|
|
|
/* border-left: 0 !important;*/ |
|
|
|
/*}*/ |
|
|
|
|
|
|
|
/deep/ .tab-headerg { |
|
|
|
height: 35px; |
|
|
|
background-color: #EDF1F7; |
|
|
|
padding: 20px 20px; |
|
|
|
.icon { |
|
|
|
color: #e84026; |
|
|
|
margin-right: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.icon { |
|
|
|
color: #e84026; |
|
|
|
margin-right: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.specialCol { |
|
|
|
min-height: 30px !important; |
|
|
|
border: 0 !important; |
|
|
|
font-size: 14px; |
|
|
|
color: #606266; |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
</style> |
|
|
|