电子面单前端页面

master
chc 2022-08-31 17:27:09 +08:00
parent 32336decc6
commit 9ce3a5e916
3 changed files with 326 additions and 130 deletions

View File

@ -10,6 +10,9 @@
<FormItem label="reqURL" prop="reqURL"> <FormItem label="reqURL" prop="reqURL">
<Input v-model="formValidate.reqURL" /> <Input v-model="formValidate.reqURL" />
</FormItem> </FormItem>
<FormItem label="电子面单URL" prop="sheetReqURL">
<Input v-model="formValidate.sheetReqURL" />
</FormItem>
<div class="label-btns"> <div class="label-btns">
<Button type="primary" @click="submit('formValidate')"></Button> <Button type="primary" @click="submit('formValidate')"></Button>
@ -24,7 +27,7 @@ export default {
data() { data() {
return { return {
ruleValidate: {}, // ruleValidate: {}, //
formValidate: { ebusinessID: "", reqURL: "", appKey: "" }, // formValidate: { ebusinessID: "", reqURL: "", appKey: "" ,sheetReqURL: "" ,}, //
}; };
}, },
props: ["res",'type'], props: ["res",'type'],

View File

@ -41,6 +41,10 @@ export const getBillDetail = (id, params) => {
export const getLogistics = (id, params) => { export const getLogistics = (id, params) => {
return getRequest(`/other/logistics`, params) return getRequest(`/other/logistics`, params)
} }
//返回信息
export const getIsCheck =(logisticsId) =>{
return getRequest(`other/logistics/${logisticsId}/getStoreLogistics`)
}
// 开启物流公司 // 开启物流公司
export const logisticsChecked = (id, params) => { export const logisticsChecked = (id, params) => {
@ -117,4 +121,9 @@ export const editShipTemplate = (id, params, headers) => {
return putRequest(`/setting/freightTemplate/${id}`, params, headers) return putRequest(`/setting/freightTemplate/${id}`, params, headers)
} }
//修改电子面单等信息
export const editChecked = (logisticsId,params) => {
return putRequest(`/other/logistics/${logisticsId}/updateStoreLogistics`,params)
}

View File

@ -9,16 +9,93 @@
ref="table" ref="table"
></Table> ></Table>
</Card> </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> </div>
</template> </template>
<script> <script>
import * as API_Shop from "@/api/shops"; import * as API_Shop from "@/api/shops";
export default { export default {
name: "logistics", name: "logistics",
data() { data() {
return { return {
openModal: true,
loading: true, // loading: true, //
searchForm: { searchForm: {
// //
@ -27,6 +104,27 @@
sort: "createTime", // sort: "createTime", //
order: "desc", // 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: [ columns: [
{ {
title: "物流公司", title: "物流公司",
@ -40,9 +138,9 @@
minWidth: 120, minWidth: 120,
sortable: true, sortable: true,
render: (h, params) => { render: (h, params) => {
if(params.row.selected === null || params.row.selected === ""){ if (params.row.selected === null || params.row.selected === "") {
return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]); return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]);
}else{ } else {
return h("div", [h("tag", {props: {color: "green"}}, "开启")]); return h("div", [h("tag", {props: {color: "green"}}, "开启")]);
} }
} }
@ -53,7 +151,7 @@
align: "center", align: "center",
width: 200, width: 200,
render: (h, params) => { render: (h, params) => {
if(params.row.selected === null){ if (params.row.selected === null) {
return h("div", [ return h("div", [
h( h(
"Button", "Button",
@ -74,7 +172,7 @@
"开启" "开启"
), ),
]); ]);
}else{ } else {
return h("div", [ return h("div", [
h( h(
"Button", "Button",
@ -94,6 +192,21 @@
}, },
"关闭" "关闭"
), ),
h(
"Button",
{
props: {
type: "info",
size: "small",
},
on: {
click: () => {
this.getFaceSheetInfo(params.row);
},
},
},
"修改"
),
]); ]);
} }
@ -101,9 +214,21 @@
}, },
], ],
data: [], // data: [], //
onpenText: false,
}; };
}, },
methods: { methods: {
//
getfaceSheetFlag(e) {
console.log(e);
if (e === true) {
console.log("打开");
this.onpenText = true;
} else {
console.log("关闭");
this.onpenText = false;
}
},
// //
init() { init() {
this.getDataList(); this.getDataList();
@ -121,24 +246,77 @@
}, },
// //
open(v) { open(v) {
this.$Modal.confirm({ this.modalTitle = v;
title: "确认开启", this.openModal = true;
// this.searchForm.faceSheetFlag = "false"; // v
content: "您确认开启此物流公司?", if (this.searchForm.faceSheetFlag == "true") {
loading: true, this.onpenText = true;
onOk: () => { } else {
API_Shop.logisticsChecked(v.id).then((res) => { this.onpenText = false;
}
},
//
getFaceSheetInfo(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.onpenText = true;
} else {
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;
}
});
},
frontDownload(val) {
var a = document.createElement("a"); //<a></a>
//
if (val === 'use') {
a.href = "static/open.xlsx"; // ahref .
a.download = "使用说明.xlsx"; //.xlsxpdf.fpd
} else if (val === 'type') {
a.href = "static/logisticsType.xlsx"; // ahref .
a.download = "快递类型.xlsx"; //.xlsxpdf.fpd
}
a.style.display = "none"; // a
document.body.appendChild(a); // a
a.click(); // aahref
a.remove(); // a
},
submit() {
if (v.selected === null || v.selected === "") {
API_Shop.logisticsChecked(
this.modalTitle.logisticsId,
this.faceSheetForm
).then((res) => {
this.openModal = false;
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
this.$Message.success("物流公司开启成功"); this.$Message.success("物流公司开启成功");
this.init(); this.init();
} }
}); });
} else {
API_Shop.editChecked(this.logisticsId, this.faceSheetForm).then((res) => {
if (res.success) {
this.$Message.success("修改成功");
this.init();
} }
}); });
}
}, },
// //
close(v){ close(v) {
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认关闭", title: "确认关闭",
content: "您确认关闭此物流公司?", content: "您确认关闭此物流公司?",
@ -158,5 +336,11 @@
mounted() { mounted() {
this.init(); this.init();
}, },
}; };
</script> </script>
<style lang="scss" scoped>
.faceSheetInput{
width: 300px;
}
</style>