|
@@ -37,7 +37,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
class="readonly"
|
|
|
>
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.contractNo"
|
|
|
+ v-model="deptBudgetList.warehouseName"
|
|
|
placeholder="请输入仓库名"
|
|
|
maxlength="20"
|
|
|
size="small"
|
|
@@ -46,7 +46,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
<!--负责人-->
|
|
|
<ws-form-item label="负责人" span="1" prop="buyer" class="readonly">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.buyer"
|
|
|
+ v-model="deptBudgetList.personCharge"
|
|
|
placeholder="请输入负责人姓名"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
@@ -56,7 +56,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
<!--负责人电话-->
|
|
|
<ws-form-item label="负责人电话" span="1" prop="shippingType">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.shippingType"
|
|
|
+ v-model="deptBudgetList.personPhone"
|
|
|
placeholder="请输入负责人手机号码"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
@@ -65,79 +65,26 @@ npm install vue-amap --save// 仓库添加
|
|
|
|
|
|
<!--仓库所在地-->
|
|
|
<ws-form-item label="仓库所在地" span="1" prop="acceptanceMethod">
|
|
|
- <el-select
|
|
|
- v-model="deptBudgetList.acceptanceMethod"
|
|
|
- placeholder="请选择仓库所在地"
|
|
|
- style="width: 100%"
|
|
|
- filterable
|
|
|
- @change="selectunitList"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in unitList"
|
|
|
- :key="item.constValue"
|
|
|
- :label="item.constValue"
|
|
|
- :value="item.constValue"
|
|
|
- >
|
|
|
- <span class="unit-left" style="float: left">
|
|
|
- <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
|
|
|
- <!-- 新增文本框 -->
|
|
|
- <div
|
|
|
- style="width: 160px"
|
|
|
- v-if="item.flag !== 'delete'"
|
|
|
- @click.stop
|
|
|
- >
|
|
|
- <ws-input
|
|
|
- v-model="item.constValue"
|
|
|
- clearable
|
|
|
- maxlength="10"
|
|
|
- style="width: 100%"
|
|
|
- ></ws-input>
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">
|
|
|
- <!-- 对号 -->
|
|
|
- <i
|
|
|
- class="el-icon-check"
|
|
|
- style="line-height: 29px; margin-left: 10px"
|
|
|
- v-if="item.flag !== 'delete'"
|
|
|
- @click.stop="saveClick(item, index)"
|
|
|
- ></i>
|
|
|
- <!-- 编辑 -->
|
|
|
- <i
|
|
|
- class="el-icon-edit"
|
|
|
- style="line-height: 29px; margin-left: 10px"
|
|
|
- v-if="item.flag == 'delete'"
|
|
|
- @click.stop="editClick(item, index)"
|
|
|
- ></i>
|
|
|
- <!-- 删除 -->
|
|
|
- <i
|
|
|
- class="el-icon-delete"
|
|
|
- style="line-height: 29px"
|
|
|
- @click.stop="deleteClick(item, index)"
|
|
|
- ></i>
|
|
|
- </span>
|
|
|
- </el-option>
|
|
|
- <!-- 新增按钮 -->
|
|
|
- <el-option value="" label="">
|
|
|
- <div
|
|
|
- style="
|
|
|
- text-align: right;
|
|
|
- border-top: 1px solid #dcdfe6;
|
|
|
- padding: 5px;
|
|
|
- "
|
|
|
- >
|
|
|
- <ws-button type="primary" @click.stop="addClick">{{
|
|
|
- $t('button.add')
|
|
|
- }}</ws-button>
|
|
|
- </div>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-cascader
|
|
|
+ :options="options_"
|
|
|
+ v-model="selectedOptions"
|
|
|
+ clearable
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择交货地"
|
|
|
+ style="width: 200%"
|
|
|
+ @change="handleChange"
|
|
|
+ />
|
|
|
</ws-form-item>
|
|
|
|
|
|
<!--详细地址-->
|
|
|
- <ws-form-item label="详细地址" span="1" prop="buyer" class="readonly">
|
|
|
+ <ws-form-item
|
|
|
+ label="详细地址"
|
|
|
+ span="1"
|
|
|
+ prop="detailedAddress"
|
|
|
+ class="readonly"
|
|
|
+ >
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.buyer"
|
|
|
+ v-model="deptBudgetList.detailedAddress"
|
|
|
placeholder="请输入详细地址"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
@@ -147,12 +94,17 @@ npm install vue-amap --save// 仓库添加
|
|
|
<!--总吨量(吨)-->
|
|
|
<ws-form-item label="总吨量(吨)" span="1" prop="settlementMethod">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.settlementMethod"
|
|
|
+ :readonly="true"
|
|
|
+ v-model="totalStorage"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
- <div style="width: 100%" class="flex" v-for="item in freightspace">
|
|
|
+ <div
|
|
|
+ style="width: 100%"
|
|
|
+ class="flex position"
|
|
|
+ v-for="(item, index) in freightspace"
|
|
|
+ >
|
|
|
<ws-form-item
|
|
|
label="仓库编号"
|
|
|
span="1"
|
|
@@ -166,7 +118,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
- <ws-form-item label="仓位储存(吨)" span="1" prop="contractNo">
|
|
|
+ <ws-form-item label="仓位储量(吨)" span="1" prop="contractNo">
|
|
|
<ws-input
|
|
|
v-model="item.maxStorage"
|
|
|
placeholder="请输入仓位最大容量"
|
|
@@ -183,23 +135,24 @@ npm install vue-amap --save// 仓库添加
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
+ <img
|
|
|
+ width="22"
|
|
|
+ height="22"
|
|
|
+ class="add"
|
|
|
+ @click="add"
|
|
|
+ src="../../../public/img/add.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ width="22"
|
|
|
+ height="22"
|
|
|
+ class="del"
|
|
|
+ @click="del(index)"
|
|
|
+ src="../../../public/img/del.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
</ws-info-table>
|
|
|
- <img
|
|
|
- width="22"
|
|
|
- height="22"
|
|
|
- class="add"
|
|
|
- @click="add"
|
|
|
- src="../../../public/img/add.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- width="22"
|
|
|
- height="22"
|
|
|
- class="del"
|
|
|
- src="../../../public/img/del.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
</ws-form>
|
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
|
<ws-upload
|
|
@@ -216,7 +169,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
/>
|
|
|
</ws-form>
|
|
|
<!-- <ws-button @click="exportlist()"></ws-button> -->
|
|
|
- <map-drag></map-drag>
|
|
|
+ <map-drag @marker="marker" @selectedAddress="selectedAddress"></map-drag>
|
|
|
<!-- 提交 -->
|
|
|
<div style="text-align: right; padding: 10px" class="center">
|
|
|
<el-button
|
|
@@ -232,6 +185,7 @@ npm install vue-amap --save// 仓库添加
|
|
|
<script>
|
|
|
// import { getVesselOne } from '@/model/procurement/basic'
|
|
|
// import { dayjs } from 'base-core-lib'
|
|
|
+import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
|
|
|
import {
|
|
|
packList,
|
|
|
addList,
|
|
@@ -239,7 +193,7 @@ import {
|
|
|
addxiala,
|
|
|
editxiala,
|
|
|
delxiala,
|
|
|
-} from '@/model/contarct/index'
|
|
|
+} from '@/model/warehouse/index'
|
|
|
import WsUpload from '@/components/WsUpload'
|
|
|
import mapDrag from '@/components/mapdrag/mapdrag'
|
|
|
export default {
|
|
@@ -259,9 +213,13 @@ export default {
|
|
|
data() {
|
|
|
let self = this
|
|
|
return {
|
|
|
- deptBudgetList: {},
|
|
|
+ deptBudgetList: {
|
|
|
+ totalStorage: 0,
|
|
|
+ },
|
|
|
+ options_: regionData,
|
|
|
heightData: '600px',
|
|
|
zoom: 7,
|
|
|
+ selectedOptions: [],
|
|
|
center: [116.244694, 39.517344],
|
|
|
window: '',
|
|
|
polygons: [
|
|
@@ -296,81 +254,28 @@ export default {
|
|
|
name: '',
|
|
|
}
|
|
|
},
|
|
|
- activated() {
|
|
|
- setTimeout(() => {
|
|
|
- this.drawBounds()
|
|
|
- }, 200)
|
|
|
+ activated() {},
|
|
|
+ computed: {
|
|
|
+ totalStorage: function () {
|
|
|
+ var maxStorage = 0
|
|
|
+ for (var i = 0; i < this.freightspace.length; i++) {
|
|
|
+ maxStorage += Number(this.freightspace[i].maxStorage)
|
|
|
+ }
|
|
|
+ return maxStorage
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
+ marker: function (item) {
|
|
|
+ this.deptBudgetList.warehousePositioning =
|
|
|
+ item.lnglat.lat + ',' + item.lnglat.lng
|
|
|
+ },
|
|
|
+ selectedAddress(e) {
|
|
|
+ this.deptBudgetList.warehousePositioning =
|
|
|
+ e.center.lat + ',' + e.center.lng
|
|
|
+ },
|
|
|
confirmPositioncity() {
|
|
|
this.listDate.level = 'city'
|
|
|
this.listDate.country = this.name
|
|
|
- this.drawBounds()
|
|
|
- },
|
|
|
- drawBounds() {
|
|
|
- var that = this
|
|
|
- // 加载
|
|
|
- AMap.plugin('AMap.DistrictSearch', function () {
|
|
|
- var districtSearch = new AMap.DistrictSearch({
|
|
|
- // 关键字对应的行政区级别,country表示国家
|
|
|
- level: that.listDate.level,
|
|
|
- // 显示下级行政区级数,1表示返回下一级行政区
|
|
|
- subdistrict: 1,
|
|
|
- })
|
|
|
- // 搜索所有省/直辖市信息
|
|
|
- districtSearch.search(that.listDate.country, function (status, result) {
|
|
|
- if (that.listDate.level == 'country') {
|
|
|
- that.citylist = result.districtList[0].districtList
|
|
|
- }
|
|
|
- // 查询成功时,result即为对应的行政区信息
|
|
|
- })
|
|
|
- })
|
|
|
- var geocoder = new AMap.Geocoder({
|
|
|
- radius: 1000,
|
|
|
- extensions: 'all',
|
|
|
- city: '全国',
|
|
|
- })
|
|
|
- geocoder.getLocation(that.listDate.countrys, (status, result) => {
|
|
|
- if (status === 'complete' && result.geocodes.length) {
|
|
|
- let lnglat = result.geocodes[0].location
|
|
|
- self.lng = lnglat.lng
|
|
|
- self.lat = lnglat.lat
|
|
|
- self.center = [self.lng, self.lat]
|
|
|
- }
|
|
|
- })
|
|
|
- // console.log(that.district)
|
|
|
- if (!that.district) {
|
|
|
- //实例化DistrictSearch
|
|
|
- var opts = {
|
|
|
- subdistrict: 0, //获取边界不需要返回下级行政区
|
|
|
- extensions: 'all', //返回行政区边界坐标组等具体信息
|
|
|
- level: that.listDate.level, //查询行政级别为 市
|
|
|
- }
|
|
|
- that.district = new AMap.DistrictSearch(opts)
|
|
|
- }
|
|
|
- //行政区查询
|
|
|
- let code = that.listDate.country + ''
|
|
|
- // that.district.search(code, function (status, result) {
|
|
|
- // console.log(result)
|
|
|
- that.polygons = []
|
|
|
- // var bounds = result.districtList[0].boundaries
|
|
|
- // if (bounds) {
|
|
|
- // for (var i = 0, l = bounds.length; i < l; i++) {
|
|
|
- // //生成行政区划polygon
|
|
|
- // var polygon = new AMap.Polygon({
|
|
|
- // strokeWeight: 1,
|
|
|
- // path: bounds[i],
|
|
|
- // fillOpacity: 0.4,
|
|
|
- // fillColor: '#80d8ff',
|
|
|
- // strokeColor: '#0091ea',
|
|
|
- // })
|
|
|
- // that.polygons.push(polygon)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // console.log('polygons')
|
|
|
- // AMap.Polygon.bind(that.polygons)
|
|
|
- // that.$refs.map.$amap.setFitView(that.polygons) //视口自适应
|
|
|
- // })
|
|
|
},
|
|
|
// 关闭 dialog时 处理文件url 初始化upload组件
|
|
|
handleClose() {
|
|
@@ -383,6 +288,14 @@ export default {
|
|
|
remark: '',
|
|
|
})
|
|
|
},
|
|
|
+ del(index) {
|
|
|
+ if (this.freightspace.length > 1) {
|
|
|
+ this.freightspace.splice(index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleChange(value) {
|
|
|
+ this.selectedOptions = value
|
|
|
+ },
|
|
|
returnsales() {
|
|
|
this.$router.push({ path: 'purchaseContract' })
|
|
|
},
|
|
@@ -408,15 +321,24 @@ export default {
|
|
|
},
|
|
|
|
|
|
submit() {
|
|
|
+ console.log(this.freightspace)
|
|
|
+
|
|
|
this.$refs.deptBudgetList.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.deptBudgetList.compId = this.compId
|
|
|
- this.deptBudgetList.contractType = 2
|
|
|
+ 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: 'salesContract' })
|
|
|
+ this.$router.push({ path: 'warehouseManagementList' })
|
|
|
})
|
|
|
} else {
|
|
|
EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
@@ -553,12 +475,12 @@ export default {
|
|
|
.add,
|
|
|
.del {
|
|
|
position: absolute;
|
|
|
- right: 167px;
|
|
|
- top: 94px;
|
|
|
+ right: -38px;
|
|
|
+ top: 9px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.del {
|
|
|
- right: 140px;
|
|
|
+ right: -70px;
|
|
|
}
|
|
|
.amap-page-container {
|
|
|
width: 300px;
|