|
@@ -77,6 +77,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <!-- <div v-if="item.type === 'scan'">
|
|
|
+ <el-transfer v-model="value" :data="data"></el-transfer>
|
|
|
+ </div> -->
|
|
|
<div v-if="formIceTracing && item.type === 'scan'"
|
|
|
:style="{height:scanHeight(inputsList.length),width:'100%'}"></div>
|
|
|
<el-form-item :label-width="item.labelWidth" :label="item.label" :prop="item.field"
|
|
@@ -239,7 +242,7 @@
|
|
|
append-to-body @opened="mapOpened">
|
|
|
<div class="card_search_box">
|
|
|
<div style="width: 50%;">
|
|
|
- <el-input v-model="address" placeholder="请输入地址搜索" id="tipinputMap"></el-input>
|
|
|
+ <el-input v-model="inputAddress" placeholder="请输入地址搜索" id="tipinputMap"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="card_coordMap">
|
|
@@ -249,12 +252,12 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<div class="space_between_in">
|
|
|
<div class="card_coord">
|
|
|
- <div class="coord_address">当前坐标:</div>
|
|
|
- <div class="coord_address">地址:</div>
|
|
|
+ <div class="coord_address">当前坐标:{{dataForm.kqLongitude}},{{dataForm.kqLatitude}}</div>
|
|
|
+ <div class="coord_address">地址:{{dataForm.kqLocation}}</div>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<el-button @click="innerVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="innerVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="confirmLocation">确 定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</span>
|
|
@@ -356,10 +359,30 @@
|
|
|
innerVisible: false,
|
|
|
map: null,
|
|
|
|
|
|
+ inputAddress: '',
|
|
|
address: '',
|
|
|
auto: null,
|
|
|
placeSearch: null,
|
|
|
lnglat: [],
|
|
|
+ markers: [],
|
|
|
+ dataForm: {
|
|
|
+ kqLocation: undefined,
|
|
|
+ kqLongitude: undefined,
|
|
|
+ kqLatitude: undefined,
|
|
|
+ },
|
|
|
+ position: {},
|
|
|
+ city: [],
|
|
|
+ province: {},
|
|
|
+ form: {
|
|
|
+ province: {},
|
|
|
+ city: [],
|
|
|
+ address: '',
|
|
|
+ },
|
|
|
+ value: [],
|
|
|
+ data: [{
|
|
|
+ key: 1,
|
|
|
+ label: '004'
|
|
|
+ }],
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -517,35 +540,49 @@
|
|
|
// 如果有就替换,没有就添加
|
|
|
if (index == -1) {
|
|
|
this.loadedDrug = true
|
|
|
- aliMsfx({
|
|
|
- code: this.inputs,
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.inputs = ''
|
|
|
- let arr = JSON.parse(res.data)
|
|
|
- // console.log(arr, 24)
|
|
|
- if (arr.result.models.length > 0) {
|
|
|
- let drugList = {
|
|
|
- code: '',
|
|
|
- physic_name: '',
|
|
|
- physic_type_desc: '',
|
|
|
- pkg_spec_crit: '',
|
|
|
- ent_name: '',
|
|
|
+ var requestOptions = {
|
|
|
+ method: 'GET',
|
|
|
+ redirect: 'follow'
|
|
|
+ };
|
|
|
+ fetch("https://public.coldbaozhida.com/Ali_msfx/codedetail?code=" + this.inputs, requestOptions)
|
|
|
+ .then(response => response.json())
|
|
|
+ .then(data => {
|
|
|
+ if (data.status == 200) {
|
|
|
+ this.inputs = ''
|
|
|
+ let arr = JSON.parse(data.data)
|
|
|
+ // console.log(arr, 24)
|
|
|
+ if (arr.result.models.length > 0) {
|
|
|
+ let drugList = {
|
|
|
+ code: '',
|
|
|
+ physic_name: '',
|
|
|
+ physic_type_desc: '',
|
|
|
+ pkg_spec_crit: '',
|
|
|
+ ent_name: '',
|
|
|
+ }
|
|
|
+ drugList.code = arr.result.models[0].code
|
|
|
+ drugList.physic_name = arr.result.models[0].drug_ent_base_d_t_o.physic_name
|
|
|
+ drugList.physic_type_desc = arr.result.models[0].drug_ent_base_d_t_o.physic_type_desc
|
|
|
+ drugList.pkg_spec_crit = arr.result.models[0].drug_ent_base_d_t_o.pkg_spec_crit
|
|
|
+ drugList.ent_name = arr.result.models[0].p_user_ent_d_t_o.ent_name
|
|
|
+ this.commodityList.push(drugList)
|
|
|
+ this.commodityList = this.uniqueArray(this.commodityList)
|
|
|
+ this.ruleForm[`${field}`] = this.commodityList
|
|
|
+ } else {
|
|
|
+ this.$message.error('该商品不存在');
|
|
|
}
|
|
|
- drugList.code = arr.result.models[0].code
|
|
|
- drugList.physic_name = arr.result.models[0].drug_ent_base_d_t_o.physic_name
|
|
|
- drugList.physic_type_desc = arr.result.models[0].drug_ent_base_d_t_o.physic_type_desc
|
|
|
- drugList.pkg_spec_crit = arr.result.models[0].drug_ent_base_d_t_o.pkg_spec_crit
|
|
|
- drugList.ent_name = arr.result.models[0].p_user_ent_d_t_o.ent_name
|
|
|
- this.commodityList.push(drugList)
|
|
|
- this.commodityList = this.uniqueArray(this.commodityList)
|
|
|
- this.ruleForm[`${field}`] = this.commodityList
|
|
|
- } else {
|
|
|
- this.$message.warning('该商品不存在');
|
|
|
}
|
|
|
- }
|
|
|
- this.loadedDrug = false
|
|
|
- })
|
|
|
+ this.loadedDrug = false
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error('添加失败');
|
|
|
+ this.loadedDrug = false
|
|
|
+ });
|
|
|
+ // return
|
|
|
+ // aliMsfx({
|
|
|
+ // code: this.inputs,
|
|
|
+ // }).then(res => {}).catch(() => {
|
|
|
+ // this.$message.error('添加失败');
|
|
|
+ // this.loadedDrug = false
|
|
|
+ // })
|
|
|
} else {
|
|
|
this.$message.warning('该商品已存在');
|
|
|
}
|
|
@@ -554,6 +591,7 @@
|
|
|
if (res.code == 200) {
|
|
|
this.inputsList.push(this.inputs)
|
|
|
this.inputsList = this.uniqueArray(this.inputsList)
|
|
|
+ console.log(this.inputsList, 889)
|
|
|
this.inputs = ''
|
|
|
this.ruleForm[`${field}`] = this.inputsList
|
|
|
}
|
|
@@ -659,7 +697,6 @@
|
|
|
},
|
|
|
//选中查询出的记录
|
|
|
selectSite(e) {
|
|
|
- console.log(e,669)
|
|
|
if (e.poi.location) {
|
|
|
// this.lnglat = [e.poi.location.lng, e.poi.location.lat];
|
|
|
this.placeSearch.setCity(e.poi.adcode);
|
|
@@ -668,15 +705,17 @@
|
|
|
let that = this;
|
|
|
geocoder.getAddress(this.lnglat, function(status, result) {
|
|
|
if (status === "complete" && result.regeocode) {
|
|
|
- that.province = result.regeocode.addressComponent.province;
|
|
|
- that.city = result.regeocode.addressComponent.city;
|
|
|
- //自己想要赋的值,根据自己的做修改
|
|
|
- that.$set(that.form, "province", that.province);
|
|
|
+ if (result.regeocode) {
|
|
|
+ that.province = result.regeocode.addressComponent.province;
|
|
|
+ that.city = result.regeocode.addressComponent.city;
|
|
|
+ //自己想要赋的值,根据自己的做修改
|
|
|
+ that.$set(that.form, "province", that.province);
|
|
|
+ }
|
|
|
that.$set(that.form, "city", that.city);
|
|
|
that.$set(that.form, "address", e.poi.name);
|
|
|
that.$set(
|
|
|
that.form,
|
|
|
- "coordinate",
|
|
|
+ "companyCoordinate",
|
|
|
e.poi.location.lng + "," + e.poi.location.lat
|
|
|
); //纬度,经度
|
|
|
} else {}
|
|
@@ -685,8 +724,56 @@
|
|
|
this.$message.error("查询地址失败,请重新输入地址");
|
|
|
}
|
|
|
},
|
|
|
- clickMapHandler() {
|
|
|
- console.log(23)
|
|
|
+ // 点击地图事件获取经纬度,并添加标记
|
|
|
+ clickMapHandler(e) {
|
|
|
+ // console.log(e, 23)
|
|
|
+ this.dataForm.kqLongitude = e.lnglat.getLng();
|
|
|
+ this.dataForm.kqLatitude = e.lnglat.getLat();
|
|
|
+ this.lnglat = [e.lnglat.getLng(), e.lnglat.getLat()];
|
|
|
+ // this.ruleForm.companyCoordinate = e.lnglat.getLng() + ',' + e.lnglat.getLat();
|
|
|
+ this.setMarker(this.lnglat);
|
|
|
+ // 点击地图上的位置,根据经纬度转换成详细地址
|
|
|
+ let geocoder = new AMap.Geocoder({});
|
|
|
+ let that = this;
|
|
|
+ geocoder.getAddress(this.lnglat, function(status, result) {
|
|
|
+ if (status === "complete" && result.regeocode) {
|
|
|
+ // that.ruleForm.companyAddress = result.regeocode.formattedAddress;
|
|
|
+ that.dataForm.kqLocation = result.regeocode.formattedAddress;
|
|
|
+ } else {}
|
|
|
+ });
|
|
|
+ this.position = {
|
|
|
+ longitude: e.lnglat.getLng(),
|
|
|
+ latitude: e.lnglat.getLat(),
|
|
|
+ address: that.address,
|
|
|
+ };
|
|
|
+ this.inputAddress = that.address;
|
|
|
+ },
|
|
|
+ // 添加标记
|
|
|
+ setMarker(lnglat) {
|
|
|
+ this.removeMarker();
|
|
|
+ let marker = new AMap.Marker({
|
|
|
+ position: lnglat,
|
|
|
+ });
|
|
|
+ marker.setMap(this.map);
|
|
|
+ this.markers.push(marker);
|
|
|
+ },
|
|
|
+ // 删除之前后的标记点
|
|
|
+ removeMarker() {
|
|
|
+ if (this.markers) {
|
|
|
+ this.map.remove(this.markers);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 确定经纬度
|
|
|
+ confirmLocation() {
|
|
|
+ if (this.dataForm.kqLongitude) {
|
|
|
+ this.innerVisible = false
|
|
|
+ this.ruleForm.companyCoordinate = this.dataForm.kqLongitude + ',' + this.dataForm.kqLatitude
|
|
|
+ this.ruleForm.companyAddress = this.dataForm.kqLocation
|
|
|
+ this.$refs.ruleForm.validateField('companyCoordinate')
|
|
|
+ this.$refs.ruleForm.validateField('companyAddress')
|
|
|
+ } else {
|
|
|
+ this.$message.warning("请点击选择具体位置");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -833,6 +920,24 @@
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
|
|
|
+ ::v-deep .el-transfer {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .el-transfer__buttons {
|
|
|
+ display: flex;
|
|
|
+ padding: 0px 10px;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.forms_switch {
|
|
|
height: 40px;
|
|
|
width: 100%;
|
|
@@ -893,6 +998,7 @@
|
|
|
|
|
|
.card_coord {
|
|
|
display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
flex-direction: column;
|
|
|
background-color: rgba(103, 194, 58, .6);
|
|
|
padding: 4px 10px;
|