|
@@ -27,9 +27,13 @@
|
|
ref="deptBudgetList"
|
|
ref="deptBudgetList"
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:model="deptBudgetList"
|
|
:model="deptBudgetList"
|
|
- >
|
|
|
|
- <el-radio v-model="radio" label="1" checked="true">自有库</el-radio>
|
|
|
|
- <el-radio v-model="radio" label="2">临时库</el-radio>
|
|
|
|
|
|
+ >
|
|
|
|
+ <el-radio-group v-model="radio">
|
|
|
|
+ <el-radio :label="1">自有库</el-radio>
|
|
|
|
+ <el-radio :label="2">临时库</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ <!-- <el-radio v-model="radio" label="1" checked="true">自有库</el-radio>
|
|
|
|
+ <el-radio v-model="radio" label="2">临时库</el-radio> -->
|
|
<div class="small-title">基本信息</div>
|
|
<div class="small-title">基本信息</div>
|
|
<ws-info-table>
|
|
<ws-info-table>
|
|
<!--仓库名称-->
|
|
<!--仓库名称-->
|
|
@@ -95,7 +99,12 @@
|
|
</ws-form-item>
|
|
</ws-form-item>
|
|
|
|
|
|
<!--总吨量(吨)-->
|
|
<!--总吨量(吨)-->
|
|
- <ws-form-item label="总吨量(吨)" span="1" prop="settlementMethod" v-show="radio==1">
|
|
|
|
|
|
+ <ws-form-item
|
|
|
|
+ label="总吨量(吨)"
|
|
|
|
+ span="1"
|
|
|
|
+ prop="settlementMethod"
|
|
|
|
+ v-show="radio == 1"
|
|
|
|
+ >
|
|
<ws-input
|
|
<ws-input
|
|
class="totalStorage"
|
|
class="totalStorage"
|
|
:readonly="true"
|
|
:readonly="true"
|
|
@@ -108,7 +117,7 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
class="flex position"
|
|
class="flex position"
|
|
v-for="(item, index) in freightspace"
|
|
v-for="(item, index) in freightspace"
|
|
- v-show="radio==1"
|
|
|
|
|
|
+ v-show="radio == 1"
|
|
>
|
|
>
|
|
<ws-form-item
|
|
<ws-form-item
|
|
label="仓位编号"
|
|
label="仓位编号"
|
|
@@ -160,9 +169,9 @@
|
|
</ws-info-table>
|
|
</ws-info-table>
|
|
</ws-form>
|
|
</ws-form>
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
- <div class="small-title" v-show="radio==1">上传仓库照片</div>
|
|
|
|
|
|
+ <div class="small-title" v-show="radio == 1">上传仓库照片</div>
|
|
<ws-upload
|
|
<ws-upload
|
|
- v-show="radio==1"
|
|
|
|
|
|
+ v-show="radio == 1"
|
|
ref="upload"
|
|
ref="upload"
|
|
table-name="maintain_work_order"
|
|
table-name="maintain_work_order"
|
|
oss-key="mainPlan"
|
|
oss-key="mainPlan"
|
|
@@ -198,7 +207,7 @@ import {
|
|
addxiala,
|
|
addxiala,
|
|
editxiala,
|
|
editxiala,
|
|
delxiala,
|
|
delxiala,
|
|
- increase
|
|
|
|
|
|
+ increase,
|
|
} from '@/model/warehouse/index'
|
|
} from '@/model/warehouse/index'
|
|
import WsUpload from '@/components/WsUpload'
|
|
import WsUpload from '@/components/WsUpload'
|
|
import mapDrag from '@/components/mapdrag/mapdrag'
|
|
import mapDrag from '@/components/mapdrag/mapdrag'
|
|
@@ -323,7 +332,7 @@ export default {
|
|
returnsales() {
|
|
returnsales() {
|
|
this.deptBudgetList = {}
|
|
this.deptBudgetList = {}
|
|
this.freightspace = {}
|
|
this.freightspace = {}
|
|
- this.selectedOptions = ""
|
|
|
|
|
|
+ this.selectedOptions = ''
|
|
this.$router.push({ path: 'warehouseManagementList' })
|
|
this.$router.push({ path: 'warehouseManagementList' })
|
|
},
|
|
},
|
|
// confirmPosition() {
|
|
// confirmPosition() {
|
|
@@ -342,145 +351,247 @@ export default {
|
|
},
|
|
},
|
|
onChange(files) {
|
|
onChange(files) {
|
|
this.fileNum = files
|
|
this.fileNum = files
|
|
- this.$refs.upload.handleSaveBill().then((res) => {
|
|
|
|
- })
|
|
|
|
|
|
+ this.$refs.upload.handleSaveBill().then((res) => {})
|
|
},
|
|
},
|
|
|
|
|
|
submit() {
|
|
submit() {
|
|
- if (!this.deptBudgetList.warehouseName) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '仓库名称不能为空!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- this.deptBudgetList.warehouseName.length < 2 ||
|
|
|
|
- this.deptBudgetList.warehouseName.length > 20
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '仓库名长度不符合要求!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!this.deptBudgetList.personCharge) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '负责人不能为空!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- this.deptBudgetList.personCharge.length < 2 ||
|
|
|
|
- this.deptBudgetList.personCharge.length > 10
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '负责人长度不符合要求,请控制在2-10字符之内',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!this.deptBudgetList.personPhone) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '负责人电话不能为空!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (this.deptBudgetList.personPhone.length != 11) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '手机号输入有误!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- // if(!this.deptBudgetList.warehousePrivate){
|
|
|
|
- // this.$message({
|
|
|
|
- // message: '仓库所在地不能为空!',
|
|
|
|
- // type: 'warning',
|
|
|
|
- // })
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- if (!this.deptBudgetList.detailedAddress) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '详细地址不能为空!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ if (this.radio == 1) {
|
|
|
|
+ if (!this.deptBudgetList.warehouseName) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓库名称不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ this.deptBudgetList.warehouseName.length < 2 ||
|
|
|
|
+ this.deptBudgetList.warehouseName.length > 20
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓库名长度不符合要求!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.deptBudgetList.personCharge) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ this.deptBudgetList.personCharge.length < 2 ||
|
|
|
|
+ this.deptBudgetList.personCharge.length > 10
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人长度不符合要求,请控制在2-10字符之内',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.deptBudgetList.personPhone) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人电话不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.deptBudgetList.personPhone.length != 11) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '手机号输入有误!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // if(!this.deptBudgetList.warehousePrivate){
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: '仓库所在地不能为空!',
|
|
|
|
+ // type: 'warning',
|
|
|
|
+ // })
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ if (!this.deptBudgetList.detailedAddress) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '详细地址不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
- if (this.totalStorage <= 0) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '仓位储量不能为空!',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- this.deptBudgetList.detailedAddress.length < 2 ||
|
|
|
|
- this.deptBudgetList.detailedAddress.length > 20
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '详细地址长度不符合要求,请控制在2-20字符之内',
|
|
|
|
|
|
+ if (this.totalStorage <= 0) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓位储量不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ this.deptBudgetList.detailedAddress.length < 2 ||
|
|
|
|
+ this.deptBudgetList.detailedAddress.length > 20
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '详细地址长度不符合要求,请控制在2-20字符之内',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // freightspace
|
|
|
|
+ for (var i = 0; i < this.freightspace.length; i++) {
|
|
|
|
+ for (var j = i + 1; j < this.freightspace.length; j++) {
|
|
|
|
+ console.log(
|
|
|
|
+ this.freightspace[i].binNumber,
|
|
|
|
+ this.freightspace[j].binNumber
|
|
|
|
+ )
|
|
|
|
+ if (
|
|
|
|
+ this.freightspace[i].binNumber == this.freightspace[j].binNumber
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓位编号重复',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$confirm(`确定提交仓库信息?`, {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
type: 'warning',
|
|
type: 'warning',
|
|
})
|
|
})
|
|
- return
|
|
|
|
- }
|
|
|
|
- // freightspace
|
|
|
|
- for (var i = 0; i < this.freightspace.length; i++) {
|
|
|
|
- for (var j = i + 1; j < this.freightspace.length; j++) {
|
|
|
|
- console.log(
|
|
|
|
- this.freightspace[i].binNumber,
|
|
|
|
- this.freightspace[j].binNumber
|
|
|
|
- )
|
|
|
|
- if (
|
|
|
|
- this.freightspace[i].binNumber == this.freightspace[j].binNumber
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '仓位编号重复',
|
|
|
|
- type: 'warning',
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$refs.deptBudgetList.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.deptBudgetList.compId =
|
|
|
|
+ sessionStorage.getItem('ws-pf_compId')
|
|
|
|
+ this.deptBudgetList.warehousePrivate =
|
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
|
+ this.deptBudgetList.warehouseCity =
|
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
|
+ this.deptBudgetList.warehouseArea =
|
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
|
+ this.deptBudgetList.warehousePositionInfoList =
|
|
|
|
+ this.freightspace
|
|
|
|
+ this.deptBudgetList.totalStorage = this.totalStorage
|
|
|
|
+ addList(this.deptBudgetList)
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success('添加成功')
|
|
|
|
+ this.deptBudgetList = {}
|
|
|
|
+ this.freightspace = {}
|
|
|
|
+ this.selectedOptions = ''
|
|
|
|
+ this.$router.push({ path: 'warehouseManagementList' })
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ return false
|
|
|
|
+ })
|
|
|
|
+ } else if (this.radio == 2) {
|
|
|
|
+ if (!this.deptBudgetList.warehouseName) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓库名称不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- }
|
|
|
|
- this.$confirm(`确定提交仓库信息?`, {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.$refs.deptBudgetList.validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.deptBudgetList.compId =
|
|
|
|
- sessionStorage.getItem('ws-pf_compId')
|
|
|
|
- this.deptBudgetList.warehousePrivate =
|
|
|
|
- CodeToText[this.selectedOptions[0]]
|
|
|
|
- this.deptBudgetList.warehouseCity =
|
|
|
|
- CodeToText[this.selectedOptions[1]]
|
|
|
|
- this.deptBudgetList.warehouseArea =
|
|
|
|
- CodeToText[this.selectedOptions[2]]
|
|
|
|
- this.deptBudgetList.warehousePositionInfoList = this.freightspace
|
|
|
|
- this.deptBudgetList.totalStorage = this.totalStorage
|
|
|
|
- addList(this.deptBudgetList)
|
|
|
|
- .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- this.$message.success('添加成功')
|
|
|
|
- this.deptBudgetList = {}
|
|
|
|
- this.freightspace = {}
|
|
|
|
- this.selectedOptions = ""
|
|
|
|
- this.$router.push({ path: 'warehouseManagementList' })
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.deptBudgetList.warehouseName.length < 2 ||
|
|
|
|
+ this.deptBudgetList.warehouseName.length > 20
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '仓库名长度不符合要求!',
|
|
|
|
+ type: 'warning',
|
|
})
|
|
})
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.deptBudgetList.personCharge) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ this.deptBudgetList.personCharge.length < 2 ||
|
|
|
|
+ this.deptBudgetList.personCharge.length > 10
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人长度不符合要求,请控制在2-10字符之内',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.deptBudgetList.personPhone) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '负责人电话不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.deptBudgetList.personPhone.length != 11) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '手机号输入有误!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // if(!this.deptBudgetList.warehousePrivate){
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: '仓库所在地不能为空!',
|
|
|
|
+ // type: 'warning',
|
|
|
|
+ // })
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ if (!this.deptBudgetList.detailedAddress) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '详细地址不能为空!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm(`确定提交仓库信息?`, {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
})
|
|
})
|
|
- .catch(() => {
|
|
|
|
- return false
|
|
|
|
- })
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$refs.deptBudgetList.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.deptBudgetList.compId =
|
|
|
|
+ sessionStorage.getItem('ws-pf_compId')
|
|
|
|
+ this.deptBudgetList.warehousePrivate =
|
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
|
+ this.deptBudgetList.warehouseCity =
|
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
|
+ this.deptBudgetList.warehouseArea =
|
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
|
+ this.deptBudgetList.warehousePositionInfoList =
|
|
|
|
+ this.freightspace
|
|
|
|
+ this.deptBudgetList.totalStorage = this.totalStorage
|
|
|
|
+ increase(this.deptBudgetList)
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success('添加成功')
|
|
|
|
+ this.deptBudgetList = {}
|
|
|
|
+ this.freightspace = {}
|
|
|
|
+ this.selectedOptions = ''
|
|
|
|
+ this.$router.push({ path: 'warehouseManagementList' })
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ return false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
resetForm(deptBudgetList) {
|
|
resetForm(deptBudgetList) {
|
|
this.$refs[deptBudgetList].resetFields()
|
|
this.$refs[deptBudgetList].resetFields()
|