|
@@ -25,17 +25,12 @@ npm install vue-amap --save// 仓库添加
|
|
|
<ws-form
|
|
|
class="position"
|
|
|
ref="deptBudgetList"
|
|
|
- :rules="mainReportAdd"
|
|
|
+ :rules="rules"
|
|
|
:model="deptBudgetList"
|
|
|
- >
|
|
|
+ ><div class="small-title">基本信息</div>
|
|
|
<ws-info-table>
|
|
|
<!--仓库名称-->
|
|
|
- <ws-form-item
|
|
|
- label="仓库名称"
|
|
|
- span="1"
|
|
|
- prop="contractNo"
|
|
|
- class="readonly"
|
|
|
- >
|
|
|
+ <ws-form-item label="仓库名称" span="1" prop="warehouseName">
|
|
|
<ws-input
|
|
|
v-model="deptBudgetList.warehouseName"
|
|
|
placeholder="请输入仓库名"
|
|
@@ -44,7 +39,12 @@ npm install vue-amap --save// 仓库添加
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
<!--负责人-->
|
|
|
- <ws-form-item label="负责人" span="1" prop="buyer" class="readonly">
|
|
|
+ <ws-form-item
|
|
|
+ label="负责人"
|
|
|
+ span="1"
|
|
|
+ prop="personCharge"
|
|
|
+ class="readonly"
|
|
|
+ >
|
|
|
<ws-input
|
|
|
v-model="deptBudgetList.personCharge"
|
|
|
placeholder="请输入负责人姓名"
|
|
@@ -54,7 +54,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
</ws-form-item>
|
|
|
|
|
|
<!--负责人电话-->
|
|
|
- <ws-form-item label="负责人电话" span="1" prop="shippingType">
|
|
|
+ <ws-form-item label="负责人电话" span="1" prop="personPhone">
|
|
|
<ws-input
|
|
|
v-model="deptBudgetList.personPhone"
|
|
|
placeholder="请输入负责人手机号码"
|
|
@@ -70,7 +70,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
v-model="selectedOptions"
|
|
|
clearable
|
|
|
size="large"
|
|
|
- placeholder="请选择交货地"
|
|
|
+ placeholder="请选择仓库所在地"
|
|
|
style="width: 200%"
|
|
|
@change="handleChange"
|
|
|
/>
|
|
@@ -94,6 +94,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
<!--总吨量(吨)-->
|
|
|
<ws-form-item label="总吨量(吨)" span="1" prop="settlementMethod">
|
|
|
<ws-input
|
|
|
+ class="totalStorage"
|
|
|
:readonly="true"
|
|
|
v-model="totalStorage"
|
|
|
maxlength="100"
|
|
@@ -106,14 +107,14 @@ npm install vue-amap --save// 仓库添加
|
|
|
v-for="(item, index) in freightspace"
|
|
|
>
|
|
|
<ws-form-item
|
|
|
- label="仓库编号"
|
|
|
+ label="仓位编号"
|
|
|
span="1"
|
|
|
prop="contractNo"
|
|
|
class="readonly"
|
|
|
>
|
|
|
<ws-input
|
|
|
v-model="item.binNumber"
|
|
|
- placeholder="请输入仓库编号"
|
|
|
+ placeholder="请输入仓位编号"
|
|
|
maxlength="20"
|
|
|
size="small"
|
|
|
/>
|
|
@@ -131,7 +132,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
<ws-input
|
|
|
v-model="item.remark"
|
|
|
placeholder="请输入交货地"
|
|
|
- maxlength="100"
|
|
|
+ maxlength="20"
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
@@ -155,6 +156,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
</ws-info-table>
|
|
|
</ws-form>
|
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
|
+ <div class="small-title">上传仓库照片</div>
|
|
|
<ws-upload
|
|
|
ref="upload"
|
|
|
table-name="maintain_work_order"
|
|
@@ -167,9 +169,9 @@ npm install vue-amap --save// 仓库添加
|
|
|
@onChange="onChange"
|
|
|
accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
|
|
|
/>
|
|
|
+ <div style="margin-bottom: 5px" class="small-title">仓库定位</div>
|
|
|
+ <map-drag @marker="marker" @selectedAddress="selectedAddress"></map-drag>
|
|
|
</ws-form>
|
|
|
- <!-- <ws-button @click="exportlist()"></ws-button> -->
|
|
|
- <map-drag @marker="marker" @selectedAddress="selectedAddress" class="position"></map-drag>
|
|
|
<!-- 提交 -->
|
|
|
<div style="text-align: right; padding: 10px" class="center">
|
|
|
<el-button
|
|
@@ -186,12 +188,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
// import { getVesselOne } from '@/model/procurement/basic'
|
|
|
// import { dayjs } from 'base-core-lib'
|
|
|
import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
|
|
|
-import {
|
|
|
- addList,
|
|
|
- addxiala,
|
|
|
- editxiala,
|
|
|
- delxiala,
|
|
|
-} from '@/model/warehouse/index'
|
|
|
+import { addList, addxiala, editxiala, delxiala } from '@/model/warehouse/index'
|
|
|
import WsUpload from '@/components/WsUpload'
|
|
|
import mapDrag from '@/components/mapdrag/mapdrag'
|
|
|
export default {
|
|
@@ -243,13 +240,28 @@ export default {
|
|
|
listDate: { country: '中国', level: 'country', city: '' },
|
|
|
citylist: [],
|
|
|
compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
- mainReportAdd: {},
|
|
|
+ rules: {
|
|
|
+ warehouseName: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入仓库名称',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 2,
|
|
|
+ max: 20,
|
|
|
+ message: '仓库名长度不符合要求,请输入2-20字符之内',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
appendixIdsAdd: '',
|
|
|
size: 10,
|
|
|
value1: '',
|
|
|
unitList: [],
|
|
|
freightspace: [{ binNumber: '', maxStorage: '', remark: '' }],
|
|
|
name: '',
|
|
|
+ list: [],
|
|
|
}
|
|
|
},
|
|
|
activated() {},
|
|
@@ -295,7 +307,7 @@ export default {
|
|
|
this.selectedOptions = value
|
|
|
},
|
|
|
returnsales() {
|
|
|
- this.$router.push({ path: 'purchaseContract' })
|
|
|
+ this.$router.push({ path: 'warehouseManagementList' })
|
|
|
},
|
|
|
// confirmPosition() {
|
|
|
// this.draggable = false
|
|
@@ -319,30 +331,102 @@ export default {
|
|
|
},
|
|
|
|
|
|
submit() {
|
|
|
- console.log(this.freightspace)
|
|
|
-
|
|
|
- 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.$router.push({ path: 'warehouseManagementList' })
|
|
|
+ console.log(this.deptBudgetList)
|
|
|
+ if (!this.deptBudgetList.warehouseName) {
|
|
|
+ this.$message({
|
|
|
+ message: '仓库名称不能为空',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.deptBudgetList.warehouseName.length < 2 ||
|
|
|
+ this.deptBudgetList.warehouseName.length > 20
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: '仓库名称长度不符合要求,请控制在2-20字符之内',
|
|
|
+ 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.length > 11) {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ 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',
|
|
|
})
|
|
|
- } else {
|
|
|
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
- return false
|
|
|
+ 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.$router.push({ path: 'warehouseManagementList' })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
},
|
|
|
resetForm(deptBudgetList) {
|
|
|
this.$refs[deptBudgetList].resetFields()
|
|
@@ -467,6 +551,24 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+/deep/.totalStorage .el-input__inner {
|
|
|
+ color: #afb5cb;
|
|
|
+ background: #f5f7fa;
|
|
|
+}
|
|
|
+.small-title {
|
|
|
+ position: relative;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+.small-title::before {
|
|
|
+ position: absolute;
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ background: #5473e8;
|
|
|
+ width: 4px;
|
|
|
+ height: 14px;
|
|
|
+ left: 0px;
|
|
|
+ top: 13px;
|
|
|
+}
|
|
|
.position {
|
|
|
position: relative;
|
|
|
}
|
|
@@ -488,8 +590,8 @@ export default {
|
|
|
padding: 0 15%;
|
|
|
}
|
|
|
/deep/.ws-info-table .el-form-item {
|
|
|
- border-right: 1px solid #cdd2dc;
|
|
|
- border-bottom: 1px solid #cdd2dc;
|
|
|
+ border-right: 1px solid transparent;
|
|
|
+ border-bottom: 1px solid transparent;
|
|
|
}
|
|
|
.readonly {
|
|
|
position: relative;
|
|
@@ -515,6 +617,10 @@ export default {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
}
|
|
|
+.ws-info-table {
|
|
|
+ border-left: 1px solid transparent;
|
|
|
+ border-top: 1px solid transparent;
|
|
|
+}
|
|
|
.el-button--primary {
|
|
|
background-color: #5878e8;
|
|
|
border-color: #5878e8;
|
|
@@ -524,13 +630,13 @@ export default {
|
|
|
}
|
|
|
/deep/.ws-info-table .el-form-item .el-form-item__content {
|
|
|
padding: 0 25px;
|
|
|
- border-left: 1px solid #cdd2dc;
|
|
|
- background: #fafbfc;
|
|
|
+ border-left: 1px solid transparent;
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
/deep/.ws-info-table .el-form-item .el-form-item__label {
|
|
|
- width: 140px;
|
|
|
+ width: 100px;
|
|
|
text-align: center;
|
|
|
- background: #f0f2f6;
|
|
|
+ background: #fff;
|
|
|
// border: 1px solid #cdd2dc;
|
|
|
}
|
|
|
.button-container {
|
|
@@ -691,9 +797,6 @@ export default {
|
|
|
overflow: scroll;
|
|
|
height: 93vh;
|
|
|
}
|
|
|
-/deep/.ws-info-table .el-form-item .el-form-item__label {
|
|
|
- width: 130px;
|
|
|
-}
|
|
|
.ws-info-table .el-form-item {
|
|
|
width: 33.3333%;
|
|
|
}
|
|
@@ -713,45 +816,45 @@ export default {
|
|
|
width: 33.33%;
|
|
|
}
|
|
|
//去边框
|
|
|
-/deep/.el-form-item{
|
|
|
- border-right:0px;
|
|
|
- border-bottom: 0px;
|
|
|
+/deep/.el-form-item {
|
|
|
+ border-right: 0px;
|
|
|
+ border-bottom: 0px;
|
|
|
}
|
|
|
-/deep/.ws-info-table{
|
|
|
-border-left: 0px;
|
|
|
- border-top: 0px;
|
|
|
+/deep/.ws-info-table {
|
|
|
+ border-left: 0px;
|
|
|
+ border-top: 0px;
|
|
|
}
|
|
|
-.ws-info-table .el-form-item .el-form-item__content{
|
|
|
- border-right:0px;
|
|
|
- border-bottom: 0px;
|
|
|
- border-left: 0px;
|
|
|
- border-top: 0px;
|
|
|
+.ws-info-table .el-form-item .el-form-item__content {
|
|
|
+ border-right: 0px;
|
|
|
+ border-bottom: 0px;
|
|
|
+ border-left: 0px;
|
|
|
+ border-top: 0px;
|
|
|
}
|
|
|
/deep/.ws-info-table .el-form-item {
|
|
|
- border-right:0px;
|
|
|
- border-bottom: 0px;
|
|
|
- border-left: 0px;
|
|
|
- border-top: 0px;
|
|
|
-}
|
|
|
-/deep/.ws-info-table .el-form-item .el-form-item__content{
|
|
|
-background: #F5F7FA;
|
|
|
-border-radius: 4px;
|
|
|
-border: 1px solid #D8DCE6;
|
|
|
-font-family: PingFangSC-Regular, PingFang SC;
|
|
|
-margin-bottom: 5px;
|
|
|
- background-color: #fff;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 400;
|
|
|
-color: #8890B1;
|
|
|
-line-height: 16px;
|
|
|
-}
|
|
|
-/deep/.ws-info-table .el-form-item .el-form-item__label{
|
|
|
+ border-right: 0px;
|
|
|
+ border-bottom: 0px;
|
|
|
+ border-left: 0px;
|
|
|
+ border-top: 0px;
|
|
|
+}
|
|
|
+/deep/.ws-info-table .el-form-item .el-form-item__content {
|
|
|
+ background: #f5f7fa;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #d8dce6;
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ background-color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #8890b1;
|
|
|
+ line-height: 16px;
|
|
|
+}
|
|
|
+/deep/.ws-info-table .el-form-item .el-form-item__label {
|
|
|
background-color: #fff;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #8890B1;
|
|
|
- line-height: 16px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #8890b1;
|
|
|
+ line-height: 16px;
|
|
|
}
|
|
|
|
|
|
/deep/.ws-info-table .el-form-item .el-form-item__content {
|