This commit is contained in:
fengtianyangyang
2022-09-02 10:46:41 +08:00
17 changed files with 935 additions and 240 deletions

View File

@@ -9,154 +9,341 @@
ref="table"
></Table>
</Card>
<Modal v-model="openModal" :title="openModalTitle" @on-ok="submit">
<h3 style="color: #ff3c2a; margin-bottom: 10px">是否需要电子面单</h3>
<RadioGroup
v-model="faceSheetForm.faceSheetFlag"
style="margin-bottom: 20px"
@on-change="getfaceSheetFlag($event)"
>
<Radio :label="true">
<span>需要</span>
</Radio>
<Radio :label="false">
<span>不需要</span>
</Radio>
</RadioGroup>
<Card v-if="onpenText" class="modalStyle">
<h3 style="color: #ff3c2a; margin-bottom: 10px">请输入详细信息</h3>
<Form ref="formValidate" :label-width="150" label-position="right" :model="faceSheetForm" :rules="ruleValidate">
<FormItem label="customerName" prop="customerName">
<Input
v-model="faceSheetForm.customerName"
type="text"
class="faceSheetInput"
></Input
></FormItem>
<FormItem label="customerPwd" prop="customerPwd">
<Input
v-model="faceSheetForm.customerPwd"
type="text"
class="faceSheetInput"
></Input>
</FormItem>
<FormItem label="customerPwd" prop="monthCode">
<Input
v-model="faceSheetForm.monthCode"
type="text"
class="faceSheetInput"
></Input
></FormItem>
<FormItem label="customerPwd" prop="sendSite">
<Input
v-model="faceSheetForm.sendSite"
type="text"
class="faceSheetInput"
></Input
></FormItem>
<FormItem label="customerPwd" prop="sendStaff">
<Input
v-model="faceSheetForm.sendStaff"
type="text"
class="faceSheetInput"
></Input
></FormItem>
<FormItem label="支付方式" prop="payType">
<Select
v-model="faceSheetForm.payType"
class="faceSheetInput">
<Option value="1">现付</Option>
<Option value="2">到付</Option>
<Option value="3">月结</Option>
<Option value="4">第三方支付(仅SF支持)</Option>
</Select
></FormItem>
<FormItem label="快递类型" prop="expType">
<Input
v-model="faceSheetForm.expType"
type="text"
class="faceSheetInput"/>
</FormItem>
<div style="width:100%;text-align:center;">
<a style="padding-right: 20px" @click="frontDownload('use')">使用说明</a>
<a @click="frontDownload('type')">快递类型</a>
</div>
</Form>
</Card>
<br/>
</Modal>
</div>
</template>
<script>
import * as API_Shop from "@/api/shops";
import * as API_Shop from "@/api/shops";
export default {
name: "logistics",
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
export default {
name: "logistics",
data() {
return {
row: {},
openModal: false,
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
openModalTitle: '开启信息',
ruleValidate: {
customerName: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
payType: [{ required: true, message: "请填写必填项" ,trigger: "change" }],
expType: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
customerPwd: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
monthCode: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
sendSite: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
sendStaff: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
},
faceSheetForm: {
faceSheetFlag: false,
customerName: "",
payType: '1',
expType: '1',
customerPwd: "",
monthCode: "",
sendSite: "",
sendStaff: "",
},
columns: [
{
title: "物流公司",
key: "name",
minWidth: 120,
sortable: false,
},
columns: [
{
title: "物流公司",
key: "name",
minWidth: 120,
sortable: false,
},
{
title: "状态",
key: "selected",
minWidth: 120,
sortable: true,
render: (h, params) => {
if(params.row.selected === null || params.row.selected === ""){
return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]);
}else{
return h("div", [h("tag", {props: {color: "green"}}, "开启")]);
}
{
title: "状态",
key: "selected",
minWidth: 120,
sortable: true,
render: (h, params) => {
if (params.row.selected === null || params.row.selected === "") {
return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]);
} else {
return h("div", [h("tag", {props: {color: "green"}}, "开启")]);
}
},
{
title: "操作",
key: "action",
align: "center",
width: 200,
render: (h, params) => {
if(params.row.selected === null){
return h("div", [
h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.open(params.row);
},
}
},
{
title: "操作",
key: "action",
align: "center",
width: 200,
render: (h, params) => {
if (params.row.selected === null) {
return h("div", [
h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.open(params.row);
},
},
"开启"
),
]);
}else{
return h("div", [
h(
"Button",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.close(params.row);
},
},
"开启"
),
]);
} else {
return h("div", [
h(
"Button",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.close(params.row);
},
},
"关闭"
),
]);
}
},
"关闭"
),
h(
"Button",
{
props: {
type: "info",
size: "small",
},
on: {
click: () => {
this.getFaceSheetInfo(params.row);
},
},
},
"修改"
),
]);
}
},
},
],
data: [], // 表单数据
};
},
],
data: [], // 表单数据
onpenText: false,
};
},
methods: {
//获取状态
getfaceSheetFlag(e) {
console.log(e);
if (e === true) {
console.log("打开");
this.onpenText = true;
} else {
console.log("关闭");
this.onpenText = false;
}
},
methods: {
// 初始化数据
init() {
this.getDataList();
},
// 获取数据
getDataList() {
this.loading = true;
API_Shop.getLogistics().then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result;
}
});
// 初始化数据
init() {
this.getDataList();
},
// 获取数据
getDataList() {
this.loading = true;
API_Shop.getLogistics().then((res) => {
this.loading = false;
},
// 开启
open(v) {
this.$Modal.confirm({
title: "确认开启",
// 记得确认修改此处
content: "您确认开启此物流公司?",
loading: true,
onOk: () => {
API_Shop.logisticsChecked(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("物流公司开启成功");
this.init();
}
});
if (res.success) {
this.data = res.result;
}
});
this.loading = false;
},
// 开启
open(v) {
this.row = v;
this.openModal = true;
this.searchForm.faceSheetFlag = "false"; //开弹框 等于v
if (this.searchForm.faceSheetFlag == "true") {
this.onpenText = true;
} else {
this.onpenText = false;
}
},
//修改
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 = 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;
this.faceSheetForm.customerPwd = res.result.customerPwd;
this.faceSheetForm.monthCode = res.result.monthCode;
this.faceSheetForm.sendSite = res.result.sendSite;
this.faceSheetForm.sendStaff = res.result.sendStaff;
}
});
this.openModal = true;
},
frontDownload(val) {
var a = document.createElement("a"); //创建一个<a></a>标签
//根据点击按钮来下载不同文件
if (val === 'use') {
a.href = "static/open.xlsx"; // 给a标签的href属性值加上地址注意这里是绝对路径不用加 点.
a.download = "使用说明.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型pdf文件就指定.fpd即可
} else if (val === 'type') {
a.href = "static/logisticsType.xlsx"; // 给a标签的href属性值加上地址注意这里是绝对路径不用加 点.
a.download = "快递类型.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型pdf文件就指定.fpd即可
}
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签会触发a标签的href的读取浏览器就会自动下载了
a.remove(); // 一次性的用完就删除a标签
},
submit() {
if ( this.row.selected === null || this.row.selected === "") {
API_Shop.logisticsChecked(
this.row.logisticsId,
this.faceSheetForm
).then((res) => {
this.openModal = false;
this.$Modal.remove();
if (res.success) {
this.$Message.success("物流公司开启成功");
this.init();
}
});
},
// 关闭
close(v){
this.$Modal.confirm({
title: "确认关闭",
content: "您确认关闭此物流公司?",
loading: true,
onOk: () => {
API_Shop.logisticsUnChecked(v.selected).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("物流公司关闭成功");
this.init();
}
});
} else {
API_Shop.editChecked(this.logisticsId, this.faceSheetForm).then((res) => {
if (res.success) {
this.$Message.success("修改成功");
this.init();
}
});
}
},
mounted() {
this.init();
},
};
// 关闭
close(v) {
this.$Modal.confirm({
title: "确认关闭",
content: "您确认关闭此物流公司?",
loading: true,
onOk: () => {
API_Shop.logisticsUnChecked(v.selected).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("物流公司关闭成功");
this.init();
}
});
}
});
}
},
mounted() {
this.init();
},
};
</script>
<style lang="scss" scoped>
.faceSheetInput{
width: 300px;
}
</style>

View File

@@ -61,6 +61,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"
@@ -194,6 +265,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",
@@ -306,12 +378,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() {
@@ -335,8 +459,22 @@ export default {
}
});
},
<<<<<<< HEAD
pageShow(type){
this.form.pageShow = type
=======
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;
}
}
})
>>>>>>> 4ea142ea086a3f534419a31b595de80497e16d90
},
//修改售后地址
regionClick() {