|
@@ -16,6 +16,10 @@
|
|
|
</el-row>
|
|
|
<div>
|
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
|
+ <el-radio-group v-model="warehouseType" @change="warehouseTypechange">
|
|
|
+ <el-radio label="1">自有库</el-radio>
|
|
|
+ <el-radio label="2">临时库</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
<div class="small-title">基本信息</div>
|
|
|
<!--基本信息-->
|
|
|
<ws-info-table>
|
|
@@ -87,14 +91,19 @@
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
<!--总储量(吨)-->
|
|
|
- <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
|
|
|
+ <ws-form-item
|
|
|
+ v-if="warehouseType == 1"
|
|
|
+ label="总储量(吨)"
|
|
|
+ span="1"
|
|
|
+ prop="totalStorage"
|
|
|
+ >
|
|
|
<!-- <ws-input
|
|
|
v-model="deptBudgetList.totalStorage"
|
|
|
placeholder="请输入总储量(吨)"
|
|
|
maxlength="20"
|
|
|
size="small"
|
|
|
/> -->
|
|
|
- {{totalStorage}}
|
|
|
+ {{ totalStorage }}
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
<div v-for="(item, index) in deptBudgetList.warehousePositionInfoList">
|
|
@@ -146,8 +155,9 @@
|
|
|
</div>
|
|
|
</ws-form>
|
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
|
- <div class="small-title">上传仓库照片</div>
|
|
|
+ <div v-if="warehouseType == 1" class="small-title">上传仓库照片</div>
|
|
|
<ws-upload
|
|
|
+ v-if="warehouseType == 1"
|
|
|
ref="upload"
|
|
|
table-name="maintain_work_order"
|
|
|
oss-key="mainPlan"
|
|
@@ -227,6 +237,7 @@ export default {
|
|
|
contractType: 2,
|
|
|
startDate: null,
|
|
|
endDate: null,
|
|
|
+ warehouseType: '1',
|
|
|
unitList: [],
|
|
|
baseId: '',
|
|
|
// 提交类型
|
|
@@ -255,22 +266,32 @@ export default {
|
|
|
this.loaddata()
|
|
|
this.showType = this.isShow
|
|
|
},
|
|
|
-computed : {
|
|
|
- totalStorage :function() {
|
|
|
- var sum = 0
|
|
|
- if(this.deptBudgetList.warehousePositionInfoList){
|
|
|
- for(var i = 0;i < this.deptBudgetList.warehousePositionInfoList.length; i++ ){
|
|
|
- sum += Number(this.deptBudgetList.warehousePositionInfoList[i].maxStorage)
|
|
|
- }
|
|
|
- }
|
|
|
- return sum
|
|
|
+ computed: {
|
|
|
+ totalStorage: function () {
|
|
|
+ var sum = 0
|
|
|
+ if (this.deptBudgetList.warehousePositionInfoList) {
|
|
|
+ for (
|
|
|
+ var i = 0;
|
|
|
+ i < this.deptBudgetList.warehousePositionInfoList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ sum += Number(
|
|
|
+ this.deptBudgetList.warehousePositionInfoList[i].maxStorage
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sum
|
|
|
},
|
|
|
-},
|
|
|
+ },
|
|
|
methods: {
|
|
|
//返回按钮
|
|
|
returnWarehouse() {
|
|
|
this.deptBudgetList = {}
|
|
|
- this.$router.push({ path: 'warehouseManagementList' })
|
|
|
+ this.$router.push({ path: 'warehouseManagementList' })
|
|
|
+ },
|
|
|
+ warehouseTypechange() {
|
|
|
+ this.deptBudgetList = {}
|
|
|
+ this.loaddata()
|
|
|
},
|
|
|
marker: function (item) {
|
|
|
this.deptBudgetList.warehousePositioning =
|
|
@@ -351,7 +372,10 @@ computed : {
|
|
|
},
|
|
|
loaddata() {
|
|
|
// 仓库名称
|
|
|
- xiala({ compId: sessionStorage.getItem('ws-pf_compId') })
|
|
|
+ xiala({
|
|
|
+ compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
+ warehouseType: this.warehouseType,
|
|
|
+ })
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.packtypeList = response
|
|
@@ -391,21 +415,24 @@ computed : {
|
|
|
|
|
|
//提交
|
|
|
submit() {
|
|
|
- if(!this.deptBudgetList.warehouseName){
|
|
|
+ if (!this.deptBudgetList.warehouseName) {
|
|
|
this.$message({
|
|
|
message: '仓库名称不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
|
|
|
+ if (
|
|
|
+ this.deptBudgetList.warehouseName.length < 2 ||
|
|
|
+ this.deptBudgetList.warehouseName.length > 20
|
|
|
+ ) {
|
|
|
this.$message({
|
|
|
message: '仓库名长度不符合要求!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(!this.deptBudgetList.personCharge){
|
|
|
+ if (!this.deptBudgetList.personCharge) {
|
|
|
this.$message({
|
|
|
message: '负责人不能为空!',
|
|
|
type: 'warning',
|
|
@@ -422,35 +449,37 @@ computed : {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(!this.deptBudgetList.personPhone){
|
|
|
+ if (!this.deptBudgetList.personPhone) {
|
|
|
this.$message({
|
|
|
message: '负责人电话不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(this.deptBudgetList.personPhone.length != 11){
|
|
|
+ if (this.deptBudgetList.personPhone.length != 11) {
|
|
|
this.$message({
|
|
|
message: '手机号输入有误!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(!this.deptBudgetList.detailedAddress){
|
|
|
+ if (!this.deptBudgetList.detailedAddress) {
|
|
|
this.$message({
|
|
|
message: '详细地址不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- if(this.totalStorage <= 0){
|
|
|
- this.$message({
|
|
|
- message: '仓位储量不能为空!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
+ if (this.warehouseType == 1) {
|
|
|
+ if (this.totalStorage <= 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '仓位储量不能为空!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (
|
|
|
this.deptBudgetList.detailedAddress.length < 2 ||
|
|
|
this.deptBudgetList.detailedAddress.length > 20
|
|
@@ -461,14 +490,23 @@ computed : {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- for (var i = 0; i < this.deptBudgetList.warehousePositionInfoList.length; i++) {
|
|
|
- for (var j = i + 1; j < this.deptBudgetList.warehousePositionInfoList.length; j++) {
|
|
|
+ for (
|
|
|
+ var i = 0;
|
|
|
+ i < this.deptBudgetList.warehousePositionInfoList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ for (
|
|
|
+ var j = i + 1;
|
|
|
+ j < this.deptBudgetList.warehousePositionInfoList.length;
|
|
|
+ j++
|
|
|
+ ) {
|
|
|
console.log(
|
|
|
this.deptBudgetList.warehousePositionInfoList[i].binNumber,
|
|
|
this.deptBudgetList.warehousePositionInfoList[j].binNumber
|
|
|
)
|
|
|
if (
|
|
|
- this.deptBudgetList.warehousePositionInfoList[i].binNumber == this.deptBudgetList.warehousePositionInfoList[j].binNumber
|
|
|
+ this.deptBudgetList.warehousePositionInfoList[i].binNumber ==
|
|
|
+ this.deptBudgetList.warehousePositionInfoList[j].binNumber
|
|
|
) {
|
|
|
this.$message({
|
|
|
message: '仓位编号重复',
|
|
@@ -480,14 +518,15 @@ computed : {
|
|
|
}
|
|
|
this.$refs.deptBudgetList.validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.deptBudgetList.warehouseType = this.warehouseType
|
|
|
this.deptBudgetList.baseId = this.baseId
|
|
|
this.deptBudgetList.compId = this.compId
|
|
|
this.deptBudgetList.contractType = 1
|
|
|
edit(this.deptBudgetList)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
- this.$message.success('编辑成功')
|
|
|
- this.deptBudgetList = {}
|
|
|
+ this.$message.success('编辑成功')
|
|
|
+ this.deptBudgetList = {}
|
|
|
this.$router.push({ path: 'warehouseManagementList' })
|
|
|
})
|
|
|
} else {
|