Commit f5d2e8f2 authored by 邓学云's avatar 邓学云

配送价格 起送价设置

parent cdd5cc59
...@@ -96,6 +96,22 @@ export function deleteDelivery (parameter) { ...@@ -96,6 +96,22 @@ export function deleteDelivery (parameter) {
method: 'delete' method: 'delete'
}) })
} }
// 起送价列表
export function getInitialDeliveryList (parameter) {
return axios({
url: 'transport/transport-initial-prices/initial-price-list',
method: 'get',
params: parameter
})
}
// 起送价修改
export function modifyInitialDelivery (parameter) {
return axios({
url: 'transport/transport-initial-prices/revise-initial-price',
method: 'put',
data: parameter
})
}
/** /**
......
...@@ -232,7 +232,13 @@ export const asyncRouterMap = [ ...@@ -232,7 +232,13 @@ export const asyncRouterMap = [
hidden:true, hidden:true,
component: () => import('@/views/delivery/details/deliveryDetails'), component: () => import('@/views/delivery/details/deliveryDetails'),
meta: { title: '运费模板信息', keepAlive: false, permission: ['table'] } meta: { title: '运费模板信息', keepAlive: false, permission: ['table'] }
} },
{
path: '/delivery/initialDeliveryPrice',
name: 'initialDeliveryPrice',
component: () => import('@/views/delivery/initialDeliveryPrice'),
meta: { title: '起送价设置', keepAlive: false, permission: ['table'] }
},
] ]
}, },
// dashboard // dashboard
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
style="margin: 0"> style="margin: 0">
<a-row <a-row
:gutter="24"> :gutter="24">
<a-col :span="12"> <a-col :span="24">
<a-col :span="4"> <a-col :span="2">
<span>配送省份:</span> <span>配送省份:</span>
</a-col> </a-col>
<a-col :span="20" v-if="record.SELECT_AREA"> <a-col :span="22" v-if="record.SELECT_AREA">
<a-tag color="cyan" v-for="(item,index) in record.SELECT_AREA.split(',')" :key="index">{{item}}</a-tag> <a-tag color="cyan" v-for="(item,index) in record.SELECT_AREA.split(',')" :key="index">{{item}}</a-tag>
</a-col> </a-col>
<a-col :span="20" v-else> <a-col :span="22" v-else>
<span>---</span> <span>---</span>
</a-col> </a-col>
</a-col> </a-col>
......
<template>
<a-card :bordered="false">
<div>
<div class="table-page-search-wrapper">
<a-form :form="formCheck" layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item label="门店信息">
<a-input v-model="queryParam.CODE" placeholder="请输入门店名称或编号"/>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<a-button-group>
<a-button type='primary' icon='download' @click="downloadFile">批量修改起送价导入模板</a-button>
<a-upload
name="file"
:customRequest="customRequest"
>
<a-button type='primary' icon='import'>批量修改起送价</a-button>
</a-upload>
</a-button-group>
</div>
<s-table
ref="table"
size="default"
rowKey="GUID"
:columns="columns"
:data="loadData"
>
<template v-for="(col, index) in columns" v-show="col.scopedSlots" :slot="col.dataIndex" slot-scope="text, record">
<div :key="index">
<a-input
v-if="record.editable"
style="margin: -5px 0"
:value="text"
@change="e => handleChange(e.target.value, record.GUID, col, record)"
/>
<template v-else>{{ text }}</template>
</div>
</template>
<template slot="action" slot-scope="text, record">
<div class="editable-row-operations">
<span v-if="record.editable">
<a @click="() => save(record)">保存</a>
<a-divider type="vertical" />
<a-popconfirm title="真的放弃编辑吗?" @confirm="() => cancel(record)">
<a>取消</a>
</a-popconfirm>
</span>
<span v-else>
<a class="edit" @click="() => edit(record)">修改</a>
</span>
</div>
</template>
</s-table>
</div>
</a-card>
</template>
<script>
import moment from 'moment'
import axios from 'axios'
import { STable } from '@/components'
import { getInitialDeliveryList,modifyInitialDelivery } from '@/api/delivery'
import { downloadFile } from '@/api/store'
export default {
name: 'TableList',
components: {
STable
},
data () {
return {
mdl: {},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 12 }
},
columns: [
{
title: '门店名称',
dataIndex: 'NAME'
},
{
title: '门店编号',
dataIndex: 'CODE'
},
{
title: '是否启用',
dataIndex: 'STATUS',
customRender: (text) => {
if(text==1){
return '是'
}else{
return '否'
}
}
},
{
title: '起送价',
dataIndex: 'INITIAL_PRICE',
scopedSlots: { customRender: 'INITIAL_PRICE' }
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
// form
formCheck: this.$form.createForm(this),
// 查询参数
queryParam: {},//查询参数
// 加载数据方法 必须为 Promise 对象
loadData: parameter => {
return getInitialDeliveryList(Object.assign(parameter, this.queryParam))
.then(res => {
res.pageSize=res._meta.perPage;
res.page=res._meta.currentPage;
res.totalPage=res._meta.pageCount;
res.totalCount=res._meta.totalCount;
res.data.forEach(element => {
element.editable=false;
});
return res
})
}
}
},
methods: {
// 下载批量模板 xls类型(transport_initial_price_import.xls)
downloadFile(){
let downloadData={
'ENG_NAME':'transport_initial_price_import.xls',
'CN_NAME' :'批量修改起送价导入模板'
}
let ftype='application/vnd.ms-excel'
downloadFile(downloadData).then(res => {
this.common.saveFile(res,'批量修改起送价导入模板.xls',ftype)
}).catch(err => {
})
},
customRequest(files) {
},
handleChange (value, key, column, record) {
// console.log(value, key, column)
record[column.dataIndex] = value
},
edit (row) {
row.editable = true
// row = Object.assign({}, row)
},
save (row) {
row.editable = false
let modifyPrice={
GUID:row.GUID,
INITIAL_PRICE:row.INITIAL_PRICE
}
modifyInitialDelivery(modifyPrice).then(res => {
this.$message.success('修改成功!')
}).catch(err => {
})
},
cancel (row) {
row.editable = false
}
}
}
</script>
<style lang="less" scoped>
.operator {
margin-bottom: 18px;
}
.table-operator .ant-btn-group{
display: flex!important;
}
.table-operator .ant-btn-group>span{
display: inline-block;
}
.ant-upload button{
margin-right:0;
}
</style>
...@@ -418,16 +418,16 @@ export default { ...@@ -418,16 +418,16 @@ export default {
this.common.saveFile(res,fname,ftype) this.common.saveFile(res,fname,ftype)
}) })
}, },
// 下载模板门店服务评价打分模板 xlsx类型(shop_branch_score_import.xls) // 下载模板门店服务评价打分模板 xls类型(shop_branch_score_import.xls)
downloadFile(){ downloadFile(){
let downloadData={ let downloadData={
'ENG_NAME':'shop_branch_score_import.xls', 'ENG_NAME':'shop_branch_score_import.xls',
'CN_NAME' :'门店服务评价打分模板' 'CN_NAME' :'门店服务评价打分模板'
} }
let ftype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' let ftype='application/vnd.ms-excel'
downloadFile(downloadData).then(res => { downloadFile(downloadData).then(res => {
console.log(res.status) console.log(res.status)
this.common.saveFile(res,'门店服务评价打分模板',ftype) this.common.saveFile(res,'门店服务评价打分模板.xls',ftype)
}).catch(err => { }).catch(err => {
}) })
}, },
......
...@@ -272,10 +272,10 @@ export default { ...@@ -272,10 +272,10 @@ export default {
'ENG_NAME':'import_branch.xls', 'ENG_NAME':'import_branch.xls',
'CN_NAME' :'门店导入模板' 'CN_NAME' :'门店导入模板'
} }
let ftype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' let ftype='application/vnd.ms-excel'
downloadFile(downloadData).then(res => { downloadFile(downloadData).then(res => {
console.log(res) console.log(res)
this.common.saveFile(res,'门店导入模板',ftype) this.common.saveFile(res,'门店导入模板.xls',ftype)
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment