电子面单页面,导入商品

This commit is contained in:
chc
2022-09-01 18:52:11 +08:00
parent 9ce3a5e916
commit 2aceffc112
8 changed files with 271 additions and 28 deletions

View File

@@ -95,7 +95,8 @@ export default {
name: "logistics",
data() {
return {
openModal: true,
row: {},
openModal: false,
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
@@ -246,7 +247,7 @@ export default {
},
// 开启
open(v) {
this.modalTitle = v;
this.row = v;
this.openModal = true;
this.searchForm.faceSheetFlag = "false"; //开弹框 等于v
if (this.searchForm.faceSheetFlag == "true") {
@@ -257,15 +258,17 @@ export default {
},
//修改
getFaceSheetInfo(v) {
this.row = v;
this.logisticsId = v.logisticsId;
this.openModalTitle = '修改信息';
API_Shop.getIsCheck(this.logisticsId).then((res) => {
if (res.success) {
// this.searchForm = res.result.recordes;
this.faceSheetForm.faceSheetFlag = String(res.result.faceSheetFlag); //开弹框 等于v
if (this.faceSheetForm.faceSheetFlag == "true") {
this.faceSheetForm.faceSheetFlag = res.result.faceSheetFlag; //开弹框 等于v
if (this.faceSheetForm.faceSheetFlag === true) {
this.onpenText = true;
} else {
this.faceSheetForm.faceSheetFlag = false
this.onpenText = false;
}
this.faceSheetForm.customerName = res.result.customerName;
@@ -275,6 +278,7 @@ export default {
this.faceSheetForm.sendStaff = res.result.sendStaff;
}
});
this.openModal = true;
},
frontDownload(val) {
var a = document.createElement("a"); //创建一个<a></a>标签
@@ -293,10 +297,9 @@ export default {
},
submit() {
if (v.selected === null || v.selected === "") {
if ( this.row.selected === null || this.row.selected === "") {
API_Shop.logisticsChecked(
this.modalTitle.logisticsId,
this.row.logisticsId,
this.faceSheetForm
).then((res) => {
this.openModal = false;

View File

@@ -58,6 +58,77 @@
</Form-item>
</Form>
</TabPane>
<TabPane label="发货地址">
<Form
ref="addressGoods"
:model="addressGoods"
:label-width="100"
:rules="addressGoodsValidate"
>
<FormItem label="发货人姓名" prop="salesConsignorName">
<Input
v-model="addressGoods.salesConsignorName"
maxlength="11"
clearable
style="width: 20%"
>
</Input>
</FormItem>
<FormItem label="发货人手机号" prop="salesConsignorMobile">
<Input
v-model="addressGoods.salesConsignorMobile"
maxlength="11"
clearable
style="width: 20%"
>
</Input>
</FormItem>
<FormItem label="地址" prop="salesConsignorAddressId">
<Input
v-model="regionGoods"
clearable
disabled
style="width: 20%"
v-if="showRegion == false"
>
</Input>
<regionMap
style="width: 20%"
@selected="selectedRegionGoods"
v-if="showRegion == true"
/>
<Button
v-if="showRegion == false"
@click="regionClicks"
type="primary"
style="margin-left: 8px"
>修改
</Button>
</FormItem>
<!-- <FormItem label="地址名称" prop="salesConsignorAddressPath">
<Input
v-model="addressGoods.salesConsignorAddressPath"
clearable
style="width: 20%"
>
</Input>
</FormItem> -->
<FormItem label="详细地址" prop="salesConsignorDetail">
<Input
v-model="addressGoods.salesConsignorDetail"
clearable
style="width: 20%"
>
</Input>
</FormItem>
<Button
@click="SetAddressGoods"
type="primary"
style="margin-left: 8px"
>确认
</Button>
</Form>
</TabPane>
<TabPane label="退货地址" name="REFUND_GOODS_ADDRESS">
<Form
ref="addressForm"
@@ -191,6 +262,7 @@ import liliMap from "@/views/my-components/map/index";
import regionMap from "@/views/lili-components/region";
import * as RegExp from "@/libs/RegExp.js";
import Cookies from "js-cookie";
import {editDeliverAddress, getDeliverAddress} from "../../api/shops";
export default {
name: "shopSetting",
@@ -302,12 +374,64 @@ export default {
],
},
submitLoading: false, // 添加或编辑提交状态
//发货地址
addressGoods: {
salesConsignorName:" ",
salesConsignorMobile:" ",
salesConsignorAddressId: " ",
salesConsignorAddressPath: " ",
salesConsignorDetail: " ",
},
regionGoods:"",//发货地址
addressGoodsValidate: {
salesConsignorName: [
{ required: true, message: "请输入发货人姓名", trigger: "blur" },
],
salesConsignorMobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
{
pattern: RegExp.mobile,
trigger: "blur",
message: "请输入正确的手机号",
},
],
salesConsignorDetail: [
{ required: true, message: "请输入详细地址", trigger: "blur" },
],
},
};
},
methods: {
// 初始化数据
init() {
this.getShopInfo();
this.getDeliverAddress()
},
selectedRegionGoods(val){
this.regionGoods = val[1];
this.regionIdS = val[0];
},
regionClicks(){
this.showRegion = true;
this.regionIdS = "";
},
SetAddressGoods(){
console.log(this.$refs.addressGoods)
if (this.regionIdS == "") {
this.$Message.error("请选择地址");
return;
}
this.$refs.addressGoods.validate((valid) => {
if (valid) {
this.addressGoods.salesConsignorAddressPath = this.regionGoods;
this.addressGoods.salesConsignorAddressId = this.regionIdS;
API_Shop.editDeliverAddress(this.addressGoods).then(res=>{
if(res.success){
this.$Message.success("修改成功")
}
})
}
});
},
//获取店铺信息
getShopInfo() {
@@ -331,6 +455,18 @@ export default {
}
});
},
getDeliverAddress(){
API_Shop.getDeliverAddress().then(res=>{
if(res.success){
if(res.result!= '' && res.result != null){
console.log(89898999998)
this.addressGoods = res.result;
this.regionGoods = res.result.salesConsignorAddressPath;
this.regionIdS = res.result.salesConsignorAddressId;
}
}
})
},
//修改售后地址
regionClick() {
this.showRegion = true;