mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 08:55:52 +08:00
电子面单发货地址
This commit is contained in:
@@ -0,0 +1,120 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout">
|
||||||
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||||
|
<FormItem label="发货人姓名" prop="salesConsignorName">
|
||||||
|
<Input v-model="formValidate.salesConsignorName"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="发货人手机号" prop="salesConsignorMobile">
|
||||||
|
<Input v-model="formValidate.salesConsignorMobile"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="地址名称" >
|
||||||
|
{{ form.salesConsignorDetail || '暂无地址' }}
|
||||||
|
|
||||||
|
|
||||||
|
<Button style="margin-left: 10px;" @click="$refs.map.open()">选择</Button>
|
||||||
|
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="详细地址" prop="salesConsignorDetail">
|
||||||
|
<Input type="textarea" v-model="formValidate.salesConsignorDetail"/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<div class="label-btns">
|
||||||
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
<multipleMap ref="map" @callback="selectedRegion"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import multipleMap from "@/components/map/multiple-map";
|
||||||
|
|
||||||
|
import {setSetting} from "@/api/index";
|
||||||
|
import {handleSubmit} from "./validate";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ruleValidate: {}, // 验证规则
|
||||||
|
formValidate: { // 表单数据
|
||||||
|
httpUrl: ""
|
||||||
|
},
|
||||||
|
result:"",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components:{
|
||||||
|
multipleMap
|
||||||
|
},
|
||||||
|
props: ["res", "type"],
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 选中的地址
|
||||||
|
selectedRegion(val) {
|
||||||
|
if(val.type === 'select'){
|
||||||
|
const paths = val.data.map(item => item.name).join(',')
|
||||||
|
const ids = val.data.map(item => item.id).join(',')
|
||||||
|
|
||||||
|
this.$set(this.form,'salesConsignorAddressPath',paths)
|
||||||
|
this.$set(this.form,'salesConsignorAddressId',ids)
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$set(this.form,'salesConsignorAddressPath',val.data.addr)
|
||||||
|
this.$set(this.form,'salesConsignorAddressId',val.data.addrId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 保存
|
||||||
|
submit(name) {
|
||||||
|
let that = this;
|
||||||
|
if (handleSubmit(that, name)) {
|
||||||
|
this.setupSetting()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 保存设置
|
||||||
|
setupSetting() {
|
||||||
|
setSetting(this.type, this.formValidate).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("保存成功!");
|
||||||
|
} else {
|
||||||
|
this.$Message.error("保存失败!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 实例化数据
|
||||||
|
init() {
|
||||||
|
this.result = JSON.parse(this.res);
|
||||||
|
|
||||||
|
this.$set(this, "formValidate", {...this.result});
|
||||||
|
Object.keys(this.formValidate).forEach((item) => {
|
||||||
|
this.ruleValidate[item] = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写必填项",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./style.scss";
|
||||||
|
|
||||||
|
.label-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ivu-input {
|
||||||
|
width: 300px !important;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ivu-input-wrapper {
|
||||||
|
width: 300px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -62,6 +62,10 @@ export default {
|
|||||||
type: "IM_SETTING",
|
type: "IM_SETTING",
|
||||||
name: "客服设置",
|
name: "客服设置",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: "DELIVERY_SETTING",
|
||||||
|
name: "电子面单发货地址",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
authLogin: [
|
authLogin: [
|
||||||
// 登录设置
|
// 登录设置
|
||||||
|
|||||||
Reference in New Issue
Block a user