电子面单页面,导入商品
parent
9ce3a5e916
commit
2aceffc112
|
@ -7,10 +7,10 @@ var BASE = {
|
|||
// buyer: "http://localhost:8888",
|
||||
// seller: "http://localhost:8889",
|
||||
// manager: "http://localhost:8887"
|
||||
common:"http://192.168.0.113:8890",
|
||||
common:"http://127.0.0.1:8890",
|
||||
buyer:"http://192.168.0.113:8888",
|
||||
manager:"http://192.168.0.113:8887",
|
||||
seller:"http://192.168.0.113:8889"
|
||||
seller:"http://127.0.0.1:8889"
|
||||
},
|
||||
API_PROD: {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
|
|
|
@ -31,4 +31,8 @@ export const updateLogistics = (id,params) => {
|
|||
return putRequest(`/other/logistics/${id}`,params);
|
||||
};
|
||||
|
||||
export const getCheckedOn = params =>{
|
||||
return getRequest(`/other/logistics/getCheckedFaceSheet`,params);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ export const queryExportOrder = params => {
|
|||
return getRequest(`/order/order/queryExportOrder`, params);
|
||||
};
|
||||
|
||||
//获取电子面单
|
||||
export const getOrderFaceSheet= (orderSn,params) =>{
|
||||
return postRequest(`/order/order/${orderSn}/createElectronicsFaceSheet`,params)
|
||||
}
|
||||
|
||||
// 上传待发货的订单列表
|
||||
export const uploadDeliverExcel = params => {
|
||||
|
|
|
@ -48,7 +48,17 @@ export const getIsCheck =(logisticsId) =>{
|
|||
|
||||
// 开启物流公司
|
||||
export const logisticsChecked = (id, params) => {
|
||||
return postRequest(`/other/logistics/${id}`, params)
|
||||
return postRequest(`/other/logistics/${id}`, params, {
|
||||
"Content-type": "application/json"
|
||||
})
|
||||
}
|
||||
//获取发货地址
|
||||
export const getDeliverAddress = () =>{
|
||||
return getRequest(`/settings/storeSettings/storeDeliverGoodsAddress`)
|
||||
}
|
||||
//修改发货地址
|
||||
export const editDeliverAddress = (params) =>{
|
||||
return putRequest(`/settings/storeSettings/storeDeliverGoodsAddress`,params)
|
||||
}
|
||||
|
||||
// 关闭开启物流公司
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="addGoods" type="primary">添加商品</Button>
|
||||
<Button @click="openImportGoods" type="primary">导入商品</Button>
|
||||
<Dropdown @on-click="handleDropdown">
|
||||
<Button type="default">
|
||||
批量操作
|
||||
|
@ -179,6 +180,20 @@
|
|||
<Button type="primary" @click="saveShipTemplate">更新</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<Modal title="导入商品信息" v-model="importModal" :mask-closable="false">
|
||||
<div>
|
||||
<Upload :before-upload="handleUpload" name="files" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
multiple type="drag" :action="action" :headers="accessToken">
|
||||
<div style="padding: 50px 0">
|
||||
<Icon type="ios-cloud-upload" size="102" style="color: #3399ff"></Icon>
|
||||
<h2>选择或拖拽文件上传</h2>
|
||||
</div>
|
||||
</Upload>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="importModal = false">确定</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -192,12 +207,16 @@ import {
|
|||
deleteGoods,
|
||||
batchShipTemplate,
|
||||
} from "@/api/goods";
|
||||
import { baseUrl } from "@/libs/axios.js";
|
||||
import * as API_Shop from "@/api/shops";
|
||||
|
||||
export default {
|
||||
name: "goods",
|
||||
data() {
|
||||
return {
|
||||
accessToken: {}, // 验证token
|
||||
importModal: false,
|
||||
action: baseUrl + "/goods/import/import", // 上传接口
|
||||
id: "", //要操作的id
|
||||
loading: true, // 表单加载状态
|
||||
shipTemplateForm: {}, // 物流模板
|
||||
|
@ -486,6 +505,15 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 上传数据
|
||||
handleUpload(file) {
|
||||
this.file = file;
|
||||
this.upload();
|
||||
return false;
|
||||
},
|
||||
openImportGoods(){
|
||||
this.importModal = true
|
||||
},
|
||||
// 更新库存
|
||||
updateStock() {
|
||||
let updateStockList = this.stockList.map((i) => {
|
||||
|
@ -727,9 +755,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
this.accessToken.accessToken = this.getStore("accessToken");
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<Button v-if="allowOperation.ship" @click="orderDeliver" type="primary"
|
||||
>发货</Button
|
||||
>
|
||||
<Button @click="Toprint" type="primary" ghost v-if="allowOperation.ship">打印电子面单</Button>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
@ -439,13 +440,31 @@
|
|||
<span>订单发货</span>
|
||||
</p>
|
||||
<div>
|
||||
<Form :model="faceSheetForm" ref="faceSheetForm" v-if="facesheetFlag" :rules="faceSheetFormValidate">
|
||||
<FormItem label="物流公司" prop="logisticsId" style="position: relative" :label-width="90">
|
||||
<Select
|
||||
v-model="faceSheetForm.logisticsId"
|
||||
placeholder="请选择"
|
||||
style="width: 250px"
|
||||
>
|
||||
<Option
|
||||
v-for="(item, i) in checkedLogistics"
|
||||
:key="i"
|
||||
:value="item.logisticsId"
|
||||
>{{ item.name }}
|
||||
</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<Form
|
||||
v-else
|
||||
ref="orderDeliveryForm"
|
||||
:model="orderDeliveryForm"
|
||||
:label-width="90"
|
||||
:rules="orderDeliverFormValidate"
|
||||
style="position: relative"
|
||||
>
|
||||
|
||||
<FormItem label="物流公司" prop="logisticsId">
|
||||
<Select
|
||||
v-model="orderDeliveryForm.logisticsId"
|
||||
|
@ -455,12 +474,13 @@
|
|||
<Option
|
||||
v-for="(item, i) in checkedLogistics"
|
||||
:key="i"
|
||||
:value="item.id"
|
||||
>{{ item.name }}
|
||||
:value="item.logisticsId"
|
||||
>{{ item.name }}
|
||||
</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="物流单号" prop="logisticsNo">
|
||||
<!-- v-if="showOrder" -->
|
||||
<FormItem label="物流单号" prop="logisticsNo" >
|
||||
<Input
|
||||
v-model="orderDeliveryForm.logisticsNo"
|
||||
style="width: 250px"
|
||||
|
@ -479,6 +499,7 @@
|
|||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
import * as API_Logistics from "@/api/logistics";
|
||||
import liliMap from "@/views/my-components/map/index";
|
||||
import * as RegExp from "@/libs/RegExp.js";
|
||||
import region from "@/views/lili-components/region";
|
||||
|
@ -495,6 +516,16 @@ export default {
|
|||
region: [], //地区
|
||||
regionId: [], //地区id
|
||||
showRegion: false,
|
||||
someJSONdata: '',
|
||||
faceSheetForm: {
|
||||
logisticsId: '',
|
||||
},
|
||||
faceSheetFormValidate: {
|
||||
logisticsId: [
|
||||
{ required: true, message: "请选择物流公司"},
|
||||
],
|
||||
},
|
||||
facesheetFlag: false, //电子面单标识
|
||||
orderLogModal: false, //弹出调整价格框
|
||||
logisticsModal: false, //弹出查询物流框
|
||||
orderDeliverModal: false, //订单发货弹出框
|
||||
|
@ -716,6 +747,15 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
Toprint(){
|
||||
this.facesheetFlag = true;
|
||||
API_Logistics.getCheckedOn().then(res => {
|
||||
if (res.success) {
|
||||
this.checkedLogistics = res.result;
|
||||
this.orderDeliverModal = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改订单金额
|
||||
modifyPrice() {
|
||||
//默认要修改的金额为订单总金额
|
||||
|
@ -754,6 +794,7 @@ export default {
|
|||
},
|
||||
//订单发货
|
||||
orderDeliver() {
|
||||
this.facesheetFlag = false
|
||||
API_Order.getLogisticsChecked().then((res) => {
|
||||
if (res.success) {
|
||||
this.checkedLogistics = res.result;
|
||||
|
@ -761,21 +802,40 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
Toprints(){
|
||||
if(this.form.logisticsId != null && this.form.logisticsId != ''){
|
||||
this.orderDeliverModal = false;
|
||||
this.modalPrint = true;
|
||||
}
|
||||
},
|
||||
//订单发货提交
|
||||
orderDeliverySubmit() {
|
||||
this.$refs.orderDeliveryForm.validate((valid) => {
|
||||
if (valid) {
|
||||
API_Order.orderDelivery(this.sn, this.orderDeliveryForm).then(
|
||||
(res) => {
|
||||
if(this.facesheetFlag){
|
||||
this.$refs['faceSheetForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
API_Order.getOrderFaceSheet(this.sn, this.faceSheetForm).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success("订单发货成功");
|
||||
this.orderDeliverModal = false;
|
||||
this.getDataDetail();
|
||||
this.someJSONdata = res.result;
|
||||
this.Toprints();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$refs['orderDeliveryForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
API_Order.orderDelivery(this.sn,this.orderDeliveryForm).then(
|
||||
(res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("订单发货成功");
|
||||
this.orderDeliverModal = false;
|
||||
this.getDataDetail();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//弹出修改收货地址框
|
||||
editAddress() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue