|
|
@ -1,114 +1,76 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
|
|
|
|
<div class="tab-header webtop"> |
|
|
|
<!-- 标题 --> |
|
|
|
<div>仓库信息</div> |
|
|
|
<!-- start 添加修改按钮 --> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
<!-- end 添加修改按钮 --> |
|
|
|
<!-- end 详情按钮 --> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="listconadd"> |
|
|
|
|
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
|
|
|
|
<el-row class="first_row"> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">仓库编码</div> |
|
|
|
<el-form-item prop="warehouseCode"> |
|
|
|
<span class="addinputw addinputInfo">{{formobj.warehouseCode}}</span> |
|
|
|
<!-- <el-input v-model="formobj.warehouseCode" placeholder="仓库编码" class="addinputw addinputInfo" clearable |
|
|
|
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" /> --> |
|
|
|
<span class="addinputw addinputInfo">{{ formobj.warehouseCode }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="16"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 仓库类型</div> |
|
|
|
<el-form-item prop="warehouseTypeValue"> |
|
|
|
<el-select v-model="formobj.warehouseTypeValue" placeholder="请选择仓库类型" class="addinputw addinputInfo" |
|
|
|
@change="selectWarehouseTypeChange"> |
|
|
|
<el-option v-for="item in warehouseTypeList" :key="item.dictKey" :label="item.dictValue" |
|
|
|
:value="item.dictKey" /> |
|
|
|
<el-select v-model="formobj.warehouseTypeValue" placeholder="请选择仓库类型" class="addinputw addinputInfo" @change="selectWarehouseTypeChange"> |
|
|
|
<el-option v-for="item in warehouseTypeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 仓库名称</div> |
|
|
|
<el-form-item prop="warehouseName"> |
|
|
|
<el-input v-model="formobj.warehouseName" placeholder="按配件所属车辆品牌命名" class="addinputw addinputInfo" |
|
|
|
clearable /> |
|
|
|
<el-input v-model="formobj.warehouseName" placeholder="按配件所属车辆品牌命名" class="addinputw addinputInfo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">仓库面积</div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.squareMeter" placeholder="仓库面积" class="addinputw addinputInfo" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
<el-input v-model="formobj.squareMeter" placeholder="仓库面积" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 仓库管理员</div> |
|
|
|
<el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="manager"> |
|
|
|
<el-select v-model="formobj.manager" placeholder="请选择仓库管理员" class="addinputw addinputInfo" |
|
|
|
@change="selectManager"> |
|
|
|
<el-option v-for="item in managerList" :key="item.sid" :label="item.name" :value="item.sid" /> |
|
|
|
<el-select v-model="formobj.manager" placeholder="请选择仓库管理员" class="addinputw addinputInfo" @change="selectManager"> |
|
|
|
<el-option v-for="item in managerList" :key="item.sid" :label="item.name" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<!-- <el-input v-model="formobj.manager" placeholder="仓库管理员" class="addinputw addinputInfo" clearable /> --> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
<div class="span-sty">仓库地址</div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.address" placeholder="仓库地址" class="addinputw addinputInfo" clearable /> |
|
|
|
<el-input v-model="formobj.address" placeholder="仓库地址" class="addinputw addinputInfo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">经度</div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.longitude" placeholder="经度" class="addinputw addinputInfo" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
<el-input v-model="formobj.longitude" placeholder="经度" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="16"> |
|
|
|
<div class="span-sty">纬度</div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.latitude" placeholder="纬度" class="addinputw addinputInfo" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
<el-input v-model="formobj.latitude" placeholder="纬度" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- <el-row> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
@ -134,347 +96,257 @@ |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> --> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 排序</div> |
|
|
|
<el-form-item prop="sortNo"> |
|
|
|
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable |
|
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /> |
|
|
|
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="16"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 使用状态</div> |
|
|
|
<el-form-item prop="usageStatus"> |
|
|
|
<el-radio-group v-model="formobj.usageStatus" size="small" @change="changeTheme" |
|
|
|
class="addinputw addinputInfo"> |
|
|
|
<el-radio-group v-model="formobj.usageStatus" size="small" class="addinputw addinputInfo"> |
|
|
|
<el-radio :label="'1'">正常</el-radio> |
|
|
|
<el-radio :label="'0'">停用</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
<div class="span-sty">备注</div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.remarks" placeholder="备注" class="addinputw addinputInfo" clearable /> |
|
|
|
<el-input v-model="formobj.remarks" placeholder="备注" class="addinputw addinputInfo" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/warehouse/warehouse.js' |
|
|
|
import { |
|
|
|
typeValues, |
|
|
|
getOrgSidByPath |
|
|
|
} from '@/api/Common/dictcommons.js' |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
submitdisabled: false, |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
contacts: "", |
|
|
|
mob: "", |
|
|
|
telephone: "", |
|
|
|
manager: '', |
|
|
|
managerSid: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: "1", |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: "0", |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
}, |
|
|
|
warehouseTypeList: [], |
|
|
|
managerList: [], |
|
|
|
rules: { |
|
|
|
warehouseName: [{ |
|
|
|
required: true, |
|
|
|
message: '仓库名称不能为空', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
sortNo: [{ |
|
|
|
required: true, |
|
|
|
message: '排序不能为空', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
usageStatus: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择使用状态', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
manager: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择仓库管理员', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
warehouseTypeValue: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择仓库类型', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
} |
|
|
|
import req from '@/api/warehouse/warehouse.js' |
|
|
|
import { |
|
|
|
getTypeValueList, |
|
|
|
getOrgSidByPath |
|
|
|
} from '@/api/Common/dictcommons.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
submitdisabled: false, |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
contacts: '', |
|
|
|
mob: '', |
|
|
|
telephone: '', |
|
|
|
manager: '', |
|
|
|
managerSid: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: '1', |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: '0', |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, |
|
|
|
warehouseTypeList: [], |
|
|
|
managerList: [], |
|
|
|
rules: { |
|
|
|
warehouseName: [{ required: true, message: '仓库名称不能为空', trigger: 'blur' }], |
|
|
|
sortNo: [{ required: true, message: '排序不能为空', trigger: 'blur' }], |
|
|
|
usageStatus: [{ required: true, message: '请选择使用状态', trigger: 'change' }], |
|
|
|
manager: [{ required: true, message: '请选择仓库管理员', trigger: 'change' }], |
|
|
|
warehouseTypeValue: [{ required: true, message: '请选择仓库类型', trigger: 'change' }] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
selectManager(val) { |
|
|
|
const choose = this.managerList.filter((item) => item.sid === val) |
|
|
|
console.log('>>>>>>>>>selectWarehouseTypeChange', choose) |
|
|
|
this.formobj.manager = choose[0].name |
|
|
|
this.formobj.managerSid = choose[0].sid |
|
|
|
}, |
|
|
|
created() { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
changeTheme(val) { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
selectManager(val) { |
|
|
|
const choose = this.managerList.filter((item) => item.sid == val) |
|
|
|
console.log('>>>>>>>>>selectWarehouseTypeChange', choose) |
|
|
|
this.formobj.manager = choose[0].name |
|
|
|
this.formobj.managerSid = choose[0].sid |
|
|
|
|
|
|
|
}, |
|
|
|
getDictValue() { |
|
|
|
|
|
|
|
var params = { |
|
|
|
type: "warehouse", |
|
|
|
psid: '0' |
|
|
|
} |
|
|
|
|
|
|
|
typeValues(params).then(resp => { |
|
|
|
console.log('>>>>>>>>>typeValues', resp) |
|
|
|
getDictValue() { |
|
|
|
getTypeValueList({ type: 'warehouse', groupNum: 'shfw' }).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.warehouseTypeList = resp.data |
|
|
|
}).catch(() => {}) |
|
|
|
|
|
|
|
|
|
|
|
getOrgSidByPath({ |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath') |
|
|
|
}).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.createOrgSid = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
req.selMangerByRole({ |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid') |
|
|
|
}) |
|
|
|
.then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.managerList = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(e => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
selectWarehouseTypeChange(val) { |
|
|
|
|
|
|
|
const choose = this.warehouseTypeList.filter((item) => item.dictKey == val) |
|
|
|
console.log('>>>>>>>>>selectWarehouseTypeChange', choose) |
|
|
|
this.formobj.warehouseTypeKey = choose[0].dictKey |
|
|
|
this.formobj.warehouseTypeValue = choose[0].dictValue |
|
|
|
|
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
|
|
|
|
req.saveWarehouse(this.formobj) |
|
|
|
.then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
this.$confirm('是否继续添加仓库信息?', '温馨提示', { |
|
|
|
confirmButtonText: '是', |
|
|
|
cancelButtonText: '否', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 点击确定进行的操作 |
|
|
|
|
|
|
|
var warehouseTypeKey = this.formobj.warehouseTypeKey |
|
|
|
var warehouseTypeValue = this.formobj.warehouseTypeValue |
|
|
|
|
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: warehouseTypeKey, |
|
|
|
warehouseTypeValue: warehouseTypeValue, |
|
|
|
contacts: "", |
|
|
|
mob: "", |
|
|
|
telephone: "", |
|
|
|
manager: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: "1", |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: "0", |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 点击取消进行的操作 |
|
|
|
|
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
contacts: "", |
|
|
|
mob: "", |
|
|
|
telephone: "", |
|
|
|
manager: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: "1", |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: "0", |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
} |
|
|
|
this.$emit('doback') |
|
|
|
}); |
|
|
|
} else { |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
contacts: "", |
|
|
|
mob: "", |
|
|
|
telephone: "", |
|
|
|
manager: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: "1", |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: "0", |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
} |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.getDictValue() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.getDictValue() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
|
|
|
|
req.initWarehouse(row.sid) |
|
|
|
.then(resp => { |
|
|
|
}) |
|
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.createOrgSid = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
req.selMangerByRole({ useOrgSid: window.sessionStorage.getItem('departmentSid') }).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.managerList = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
selectWarehouseTypeChange(val) { |
|
|
|
const choose = this.warehouseTypeList.filter((item) => item.dictKey === val) |
|
|
|
console.log('>>>>>>>>>selectWarehouseTypeChange', choose) |
|
|
|
this.formobj.warehouseTypeKey = choose[0].dictKey |
|
|
|
this.formobj.warehouseTypeValue = choose[0].dictValue |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
req.saveWarehouse(this.formobj).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功', duration: 1000 }) |
|
|
|
if (this.formobj.sid === '') { |
|
|
|
this.$confirm('是否继续添加仓库信息?', '温馨提示', { |
|
|
|
confirmButtonText: '是', |
|
|
|
cancelButtonText: '否', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 点击确定进行的操作 |
|
|
|
var warehouseTypeKey = this.formobj.warehouseTypeKey |
|
|
|
var warehouseTypeValue = this.formobj.warehouseTypeValue |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: warehouseTypeKey, |
|
|
|
warehouseTypeValue: warehouseTypeValue, |
|
|
|
contacts: '', |
|
|
|
mob: '', |
|
|
|
telephone: '', |
|
|
|
manager: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: '1', |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: '0', |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 点击取消进行的操作 |
|
|
|
this.handleReturn('true') |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
warehouseName: '', |
|
|
|
warehouseCode: '由系统自动生成', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
contacts: '', |
|
|
|
mob: '', |
|
|
|
telephone: '', |
|
|
|
manager: '', |
|
|
|
longitude: '', |
|
|
|
latitude: '', |
|
|
|
usageStatus: '1', |
|
|
|
address: '', |
|
|
|
squareMeter: '', |
|
|
|
sortNo: '', |
|
|
|
remarks: '', |
|
|
|
warehouseType: '0', |
|
|
|
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|
|
|
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
} |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.getDictValue() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
}, |
|
|
|
showEdit(row) { |
|
|
|
this.getDictValue() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
req.initWarehouse(row.sid).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
} |
|
|
|
}).catch(e => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
/deep/ .el-form-item__error { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.must { |
|
|
|
color: #f00; |
|
|
|
} |
|
|
|
|
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.addinputInfo { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
|
|
|
margin-left: 120px !important; |
|
|
|
width: calc(100% - 115px); |
|
|
|
} |
|
|
|
|
|
|
|
.first_row { |
|
|
|
border-top: 1px solid #E0E3EB; |
|
|
|
} |
|
|
|
|
|
|
|
.titleOne { |
|
|
|
padding: 7px; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group { |
|
|
|
display: inline; |
|
|
|
line-height: 1px; |
|
|
|
vertical-align: middle; |
|
|
|
} |
|
|
|
/deep/ .el-form-item__error { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.must { |
|
|
|
color: #f00; |
|
|
|
} |
|
|
|
|
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.addinputInfo { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
|
|
|
margin-left: 120px !important; |
|
|
|
width: calc(100% - 115px); |
|
|
|
} |
|
|
|
|
|
|
|
.first_row { |
|
|
|
border-top: 1px solid #E0E3EB; |
|
|
|
} |
|
|
|
|
|
|
|
.titleOne { |
|
|
|
padding: 7px; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group { |
|
|
|
display: inline; |
|
|
|
line-height: 1px; |
|
|
|
vertical-align: middle; |
|
|
|
} |
|
|
|
</style> |
|
|
|