Commit f367dcf5 authored by Your Name's avatar Your Name

提交问题

parent b97aac20
......@@ -14,9 +14,43 @@ import homeUrl from './homeURL'
* @param parameter
* @returns {*}
*/
// 获取配送方式列表
// 获取快递方式列表
export function getDistributionModeList(parameter) {
console.log(parameter)
return axios({
url: 'transport/companies/company-list',
method: 'get',
params: parameter
})
}
// 获取快递方式详情
export function getCompanyDetail(parameter) {
return axios({
url: 'transport/companies/company-detail',
method: 'get',
params: {
'guid':parameter
}
})
}
//修改快递方式详情
export function modifyCompanyDetail(parameter) {
return axios({
url: 'transport/companies/company-revise',
method: 'put',
data: parameter
})
}
// 添加快递方式
export function addCompanyDetail(parameter) {
return axios({
url: 'transport/transport-settings/transport-fee-add',
method: 'post',
data: parameter
})
}
// 获取配送方式列表
export function getTransportMethod(parameter) {
console.log(parameter)
return axios({
url: 'transport/transport-methods/get-transport-method',
......@@ -24,6 +58,14 @@ export function getDistributionModeList(parameter) {
params: parameter
})
}
// 添加配送方式
export function addDistributionManage(parameter) {
return axios({
url: 'transport/transport-methods/transport-method-insert',
method: 'post',
data: parameter
})
}
// 获取O2O配送费列表
export function getExpressPrice(parameter) {
console.log(parameter)
......
......@@ -208,12 +208,26 @@ export const asyncRouterMap = [
component: () => import('@/views/delivery/distributionMode'),
meta: { title: '快递方式', keepAlive: false, permission: ['table'] }
},
{
path: '/delivery/details/companyDetail',
name: 'companyDetail',
hidden:true,
component: () => import('@/views/delivery/details/companyDetail'),
meta: { title: '编辑快递方式', keepAlive: false, permission: ['table'] }
},
{
path: '/delivery/distributionManage',
name: 'distributionManage',
component: () => import('@/views/delivery/distributionManage'),
meta: { title: '配送方式管理', keepAlive: false, permission: ['table'] }
},
{
path: '/delivery/details/distributionDetail',
name: 'distributionDetail',
hidden:true,
component: () => import('@/views/delivery/details/distributionDetail'),
meta: { title: '编辑配送方式管理', keepAlive: false, permission: ['table'] }
},
{
path: '/delivery/expressPrice',
name: 'expressPrice',
......
......@@ -22,7 +22,8 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="拥有权限" >
<a-radio-group v-decorator="['ROLE_ID',{normalize:checkRadio}]">
<a-radio v-for="(item,index) in grouplist" :key="index" :value="item.ID">{{ item.NAME }}</a-radio>
<!-- <a-radio v-for="(item,index) in grouplist" :key="index" :value="item.ID">{{ item.NAME }}</a-radio> -->
<a-radio v-for="(group, index) in grouplist" :key="index" :value="group.ID">{{ group.NAME }}</a-radio>
</a-radio-group>
</a-form-item>
......
......@@ -98,8 +98,8 @@ export default {
this.$router.push({path:'/authority/details/Manage_editor',query:{GUID:GUID}})
// this.$router.push({path:'/authority/details/Manage_editor',query:{goid:1}})
}else{
console.log(value)
this.$router.push({path:'/authority/details/Manage_editor',query:{goid:0,GUID:value.GUID}})
// console.log(value)
this.$router.push({path:'/authority/details/Manage_editor'})
}
},
......
......@@ -3,7 +3,7 @@
<a-card style="margin-bottom:10px">
<a-form :form="newform" layout="inline">
<a-row :gutter="16" type="flex" justify="start">
<a-col :span="6">
<!-- <a-col :span="6">
<a-form-item label="名称:">
<a-input type="text" v-model="queryParam.TITLE"> </a-input>
</a-form-item>
......@@ -15,15 +15,16 @@
<a-radio-button value="1">禁用</a-radio-button>
</a-radio-group>
</a-form-item>
</a-col>
</a-col> -->
<a-col :span="6">
<a-form-item>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button>
<a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
<!-- <a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button> -->
</a-form-item>
</a-col>
</a-row>
</a-form>
<s-table
style="margin-top:10px"
ref="table"
......@@ -31,9 +32,31 @@
rowKey="ID"
:columns="columns"
:data="loadData"
:scroll="{ x: 1200, y:300 }"
:scroll="{ x: 1200, y: 300 }"
:showPagination="pagination"
>
<span slot="TITLE" slot-scope="">
<template>
<div>
<!-- <a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" /> -->
<a-tree
@expand="onExpand"
:expandedKeys="expandedKeys"
:autoExpandParent="autoExpandParent"
:treeData="gData"
>
<template slot="title" slot-scope="{ title }">
<span v-if="title.indexOf(searchValue) > -1">
{{ title.substr(0, title.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else>{{ title }}</span>
</template>
</a-tree>
</div>
</template>
</span>
<span slot="action" slot-scope="text, record">
<template>
<a @click="handleEdit(record)">编辑</a>
......@@ -125,13 +148,73 @@
import moment from 'moment'
import { STable } from '@/components'
import { getMenuList } from '@/api/authority'
const x = 3;
const y = 2;
const z = 1;
const gData = [];
const generateData = (_level, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || gData;
const children = [];
for (let i = 0; i < x; i++) {
const key = `${preKey}-${i}`;
tns.push({ title: key, key, scopedSlots: { title: 'title' } });
if (i < y) {
children.push(key);
}
}
if (_level < 0) {
return tns;
}
const level = _level - 1;
children.forEach((key, index) => {
tns[index].children = [];
return generateData(level, key, tns[index].children);
});
};
generateData(z);
const dataList = [];
const generateList = data => {
for (let i = 0; i < data.length; i++) {
const node = data[i];
const key = node.key;
dataList.push({ key, title: key });
if (node.children) {
generateList(node.children, node.key);
}
}
};
generateList(gData);
const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children);
}
}
}
return parentKey;
};
export default {
name:"authority",
name: 'authority',
components: {
STable
},
data() {
return {
expandedKeys: [],
searchValue: '',
autoExpandParent: true,
gData,
// loading: false,
// parentTreeSelected: {},
labelCol: {
......@@ -142,7 +225,7 @@ export default {
},
// 查询参数
queryParam: {},
newform: this.$form.createForm(this),
newform: this.$form.createForm(this),
// rowSelection: {
// type: 'radio',
// selectedRowKeys: []
......@@ -150,17 +233,24 @@ export default {
columns: [
{
title: '菜单名称',
dataIndex: 'TITLE',
width:200,
key:'TITLE',
fixed:'left'
// dataIndex: 'TITLE',
fixed: 'left',
width: 200,
scopedSlots: { customRender: 'TITLE' }
},
// {
// title: '菜单名称',
// dataIndex: 'TITLE',
// width:200,
// key:'TITLE',
// fixed:'left'
// },
{
title: '节点id',
dataIndex: 'ID',
width:90,
key:'ID',
fixed:'left'
width: 90,
key: 'ID',
fixed: 'left'
// customRender: (value, row, index) => {
// var ret = []
// // 添加icon
......@@ -180,32 +270,32 @@ export default {
{
title: '菜单地址',
dataIndex: 'NAME',
width:200
width: 200
},
{
title: '菜单状态',
dataIndex: 'STATUS',
width:150
width: 150
},
{
title: '是否为菜单',
dataIndex: 'IS_MENU',
width:100
width: 100
},
{
title: '是否顶部菜单',
dataIndex: 'IS_TOP_MENU',
width:100
width: 100
},
{
title: '是否默认显示',
dataIndex: 'IS_DEFAULT_SHOW',
width:150
width: 150
},
{
title: '描述',
dataIndex: 'REMARK',
width:90
width: 90
},
// {
// title: '类型',
......@@ -227,12 +317,12 @@ export default {
{
title: '排序',
dataIndex: 'SORT',
width:100
width: 100
},
{
title: '类型',
dataIndex: 'LEVEL',
width:100
width: 100
// customRender: (state, row, index) => {
// return <div>{state === 0 ? <a-tag color="cyan">显示</a-tag> : <a-tag color="red">隐藏</a-tag>}</div>
// }
......@@ -241,25 +331,25 @@ export default {
{
title: '操作',
dataIndex: 'action',
fixed:'right',
width:100,
fixed: 'right',
width: 100,
scopedSlots: { customRender: 'action' }
}
],
listData:[],
pagination:false,
listData: [],
pagination: false,
// 加载数据方法 必须为 Promise 对象
loadData: parameter => {
return getMenuList().then(res => {
// res.pageSize = res._meta.perPage
// res.page = res._meta.currentPage
// res.totalPage = res._meta.pageCount
// res.totalCount = res._meta.totalCount
console.log(res)
this.listData = res
res.data=this.listData
return res
})
return getMenuList().then(res => {
// res.pageSize = res._meta.perPage
// res.page = res._meta.currentPage
// res.totalPage = res._meta.pageCount
// res.totalCount = res._meta.totalCount
console.log(res)
this.listData = res
res.data = this.listData
return res
})
},
selectedRowKeys: [],
selectedRows: [],
......@@ -277,223 +367,40 @@ export default {
}
},
methods: {
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onChange(e) {
const value = e.target.value;
const expandedKeys = dataList
.map(item => {
if (item.key.indexOf(value) > -1) {
return getParentKey(item.key, gData);
}
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
Object.assign(this, {
expandedKeys,
searchValue: value,
autoExpandParent: true,
});
},
// secondLoad(){
loadData:parameter => {
return getMenuList(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
this.listData = res
res.data=this.listData
return res
})
// }
},
// regetTreeData () {
// if (this.modalTreeData.length <= 0) {
// getMenuList({}).then(res => {
// this.modalTreeData = [{ id: 0, name: '主菜单', type: 'D' }]
// this.modalTreeData[0].children = res.data
// this.makeTreeDataSafe(this.modalTreeData)
// })
// }
// },
// customRow (record) {
// return {
// on: {
// click: () => {
// this.rowSelection.selectedRowKeys = [record.id]
// this.tableSelected = record
// }
// }
// }
// },
// parentTreeSelect (value, node, extra) {
// this.parentTreeSelected = extra.selectedNodes[0].data.props
// },
// getMenuById (data, id) {
// if (id === null) return null
// for (var i = 0; i < data.length; i++) {
// if (data[i].id === id) {
// return data[i]
// }
// if (data[i].children) {
// var ret = null
// if ((ret = this.getMenuById(data[i].children, id))) {
// return ret
// }
// }
// }
// },
// initMenuParams () {
// this.modalParams = {
// pMenu: '',
// pid: '',
// type: 'M',
// permName: '',
// name: '',
// path: '',
// component: '',
// icon: ''
// }
// },
// addMenuClick () {
// if (this.tableSelected.type === 'B') {
// this.$error({ title: '按钮下不能创建子项' })
// return
// }
// this.editType = 'add'
// this.initMenuParams()
// this.modalParams.pMenu = this.tableSelected.name ? this.tableSelected.name : '主菜单'
// this.modalParams.pid = this.tableSelected.id ? this.tableSelected.id : 0
// if (this.tableSelected.type === 'M') {
// this.modalParams.type = 'B'
// }
// this.showMenuModal = true
// },
// editMenuClick () {
// if (!this.tableSelected.id) {
// this.$message.warning('请选择要修改的菜单项', 5)
// return
// }
// this.editType = 'update'
// this.initMenuParams()
// this.tableSelected = this.getMenuById(this.data, this.tableSelected.id)
// Object.assign(this.modalParams, this.tableSelected)
// var parentMenu = this.getMenuById(this.modalTreeData, this.modalParams.pid)
// this.modalParams.pMenu = parentMenu.name
// this.showMenuModal = true
// },
// deleteMenuClick () {
// if (!this.tableSelected.id) {
// this.$message.warning('请选择要删除的菜单项', 5)
// return
// }
// this.$confirm({
// title: `确认删除菜单【${this.tableSelected.name}】吗?`,
// onOk: () => {
// deleteMenu(this.tableSelected.id).then(res => {
// if (!res.code) {
// this.tableSelected = {}
// this.$message.success('删除成功', 5)
// this.getData()
// this.updateModalTreeIfNeed()
// } else {
// this.$error({ title: `删除失败:${res.msg}` })
// }
// })
// }
// })
// },
// makeMenuTypeSafe (rule, value, cb) {
// var parentType = 'D'
// if (this.parentTreeSelected.type) {
// // 用户自己选择父菜单
// parentType = this.parentTreeSelected.type
// } else if (this.modalParams.pid) {
// // 对话框刚打开时
// var parentMenu = this.getMenuById(this.modalTreeData, this.modalParams.pid)
// parentType = parentMenu ? parentMenu.type : 'D'
// }
// if (parentType === 'M' && value !== 'B') {
// cb(new Error('菜单下只能包含按钮'))
// } else if (parentType === 'D' && value === 'B') {
// cb(new Error('目录下不能包含按钮'))
// } else if (parentType === 'B') {
// cb(new Error('按钮下不能包含子项'))
// }
// cb()
// },
// updateModalTreeIfNeed () {
// if (Object.keys(this.params).length === 0) {
// this.modalTreeData = []
// this.regetTreeData()
// }
// },
// editMenu () {
// this.form.validateFields((err, values) => {
// if (!err) {
// if (this.editType === 'add') {
// addMenu(values).then(res => {
// if (!res.code) {
// this.showMenuModal = false
// this.$message.success('添加成功', 5)
// this.getData()
// this.updateModalTreeIfNeed()
// } else {
// this.$error({ title: `添加失败:${res.msg}` })
// }
// })
// } else if (this.editType === 'update') {
// // 修改父菜单
// if (this.parentTreeSelected.id) {
// values.pid = this.parentTreeSelected.id
// if (values.pid === values.id) {
// this.$error({ title: `父菜单不能是自身` })
// return
// }
// }
// updateMenu(values).then(res => {
// if (!res.code) {
// this.showMenuModal = false
// this.$message.success('修改成功', 5)
// this.getData()
// if (this.parentTreeSelected.id) {
// // 更新下树结构
// this.updateModalTreeIfNeed()
// }
// } else {
// this.$error({ title: `修改失败:${res.msg}` })
// }
// })
// }
// }
// })
// },
// getData () {
// this.loading = true
// getMenuList(this.params).then(res => {
// this.loading = false
// this.data = res.data
// // 设置第一层级默认展开
// // this.expandedRowKeys.push(...this.data.map(item => item.id))
// if (Object.keys(this.params).length === 0 && this.modalTreeData.length <= 0) {
// this.modalTreeData = [{ id: 0, name: '主菜单', type: 'D' }]
// this.modalTreeData[0].children = JSON.parse(JSON.stringify(this.data))
// this.makeTreeDataSafe(this.modalTreeData)
// }
// })
// },
// makeTreeDataSafe (data) {
// // 修改为antd控件需要的不同属性名
// for (var i = data.length - 1; i >= 0; i--) {
// var item = data[i]
// if (item.type === 'B') {
// data.splice(i, 1)
// }
// item.title = item.name
// item.key = item.id
// item.value = item.name
// if (item.children) {
// this.makeTreeDataSafe(item.children)
// }
// }
// }
loadData: parameter => {
return getMenuList(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
this.listData = res
res.data = this.listData
return res
})
}
}
// created () {
// this.getData()
// },
// watch: {
// showMenuModal (newVal) {
// if (newVal) {
// this.parentTreeSelected = {}
// this.$nextTick(() => {
// this.form.setFieldsValue(this.modalParams)
// })
// }
// }
// }
}
</script>
<style>
......
<template>
<a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="快递方式CODE">
<a-input
v-decorator="['CODE', { rules: [{ required: true, message: '请输入快递方式CODE' }] }]"
name="CODE"
placeholder="请输入快递方式CODE"
/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="快递方式名称">
<a-input
v-decorator="['NAME', { rules: [{ required: true, message: '请输入快递方式名称' }] }]"
name="NAME" placeholder="请输入快递方式名称"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号">
<a-input
v-decorator="['PHONE', { rules: [{ required: true, message: '请输入手机号' }] }]" name="PHONE" placeholder="请输入手机号"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input v-decorator="['SORT']" name="SORT" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
<a-input
v-decorator="['DESCRIPTION', { rules: [{ required: true, message: '请输入描述' }] }]" name="DESCRIPTION" placeholder="请输入描述"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否默认">
<a-radio-group v-decorator="['IS_DEFAULT', { initialValue: '0', normalize: checkRadio }]">
<a-radio value="0"></a-radio>
<a-radio value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
<a-button v-if="GUID" @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交</a-button>
<a-button v-else @click.stop.prevent="handleSubmit1()" htmlType="submit" type="primary">提交</a-button>
<a-button @click="goBack" style="margin-left: 8px">返回</a-button>
</a-form-item>
</a-form>
</a-card>
</template>
<script>
import moment from 'moment'
import { getCompanyDetail, modifyCompanyDetail, addCompanyDetail } from '@/api/delivery'
export default {
name: 'delivery',
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 12 }
},
// count: 2,
description: '表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。',
// goId: 1,
GUID: '',
// res:[],
// grouplist: [],
// form
form: this.$form.createForm(this)
}
},
mounted() {
var id = this.$route.query.GUID
console.log(id)
// var gooId = this.$route.query.goid
// this.goId = gooId
this.GUID = id
if (id) {
return getCompanyDetail(id)
.then(res => {
console.log(res)
this.form.setFieldsValue(res)
})
.catch(err => {})
}
//获取所有权限
// getManageGroupList()
// .then(res => {
// console.log(res)
// this.grouplist = res.info
// })
// .catch(err => {})
},
methods: {
// checkboxGroup处理
checkRadio(value) {
if (value) {
return value.toString()
}
},
//time
DateCheck(value) {
if (value || value != null || value != '') {
console.log(value)
return moment(value, 'YYYY-MM-DD')
}
},
// checkRadio(value) {
// if (value == null || value == '') {
// return '0'
// } else {
// return value.toString()
// }
// },
handleSubmit() {
console.log(validateFields)
const {
form: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
console.log(values)
if (!err) {
console.log(err)
const EminformanParams = { ...values }
addCompanyDetail(EminformanParams)
this.$router.push({ path: '/delivery/distributionMode' })
}
})
},
handleSubmit1() {
let guid = this.GUID
const {
form: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
if (!err) {
const CompanyModify = Object.assign({ ...values }, { GUID: guid })
// if (CompanyModify.CONTACTBIRTH_DATE) {
// CompanyModify.CONTACTBIRTH_DATE = CompanyModify.CONTACTBIRTH_DATE.format('YYYY-MM-DD')
// }
modifyCompanyDetail(EminformanModify)
this.$router.push({ path: '/delivery/distributionMode' })
}
})
},
goBack() {
this.$router.push({ path: '/delivery/distributionMode' })
}
}
}
</script>
<template>
<a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input
v-decorator="['NAME', { rules: [{ required: true, message: '名称' }] }]"
name="NAME"
placeholder="名称"
/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="小时数">
<!-- <a-input
v-decorator="['DSDINTERVAL', { rules: [{ required: true, message: '请输入小时数' }] }]"
name="DSDINTERVAL"
placeholder="请输入小时数"
/> -->
<a-row>
<a-col :span="12">
<a-input-group compact>
<a-input style="width:50%" v-decorator="['DSDINTERVAL']" placeholder="请输入小时数" />
<a-button type="primary" style="width:20%"></a-button>
</a-input-group>
</a-col>
</a-row>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="额外配送费用">
<!-- <a-input
v-decorator="['EXTRA_MONEY', { rules: [{ required: true, message: '请输入额外配送费用' }] }]"
name="EXTRA_MONEY"
placeholder="请输入额外配送费用"
/> -->
<a-row>
<a-col :span="12">
<a-input-group compact>
<a-input style="width:50%" v-decorator="['EXTRA_MONEY']" placeholder="请输入额外配送费用" />
<a-button type="primary" style="width:20%"></a-button>
</a-input-group>
</a-col>
</a-row>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="配送类型">
<a-input
v-decorator="['TRANSPOR_TYPE', { rules: [{ required: true, message: '请选择配送类型' }] }]"
name="TRANSPOR_TYPE"
placeholder="请选择配送类型"
/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input v-decorator="['ORDER_INDEX']" name="ORDER_INDEX" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否支持线下付款">
<a-radio-group v-decorator="['IS_UNDERLINE_PAY', { initialValue: '0', normalize: checkRadio }]">
<a-radio value="0"></a-radio>
<a-radio value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
<a-input
v-decorator="['DESCRIPTION', { rules: [{ required: true, message: '请输入描述' }] }]"
name="DESCRIPTION"
placeholder="请输入描述"
/>
</a-form-item>
<a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
<a-button v-if="GUID" @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交</a-button>
<a-button v-else @click.stop.prevent="handleSubmit1()" htmlType="submit" type="primary">提交</a-button>
<a-button @click="goBack" style="margin-left: 8px">返回</a-button>
</a-form-item>
</a-form>
</a-card>
</template>
<script>
import moment from 'moment'
import { addDistributionManage } from '@/api/delivery'
export default {
name: 'delivery',
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 12 }
},
// count: 2,
description: '表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。',
// goId: 1,
GUID: '',
// res:[],
// grouplist: [],
// form
form: this.$form.createForm(this)
}
},
mounted() {
var id = this.$route.query.GUID
console.log(id)
// var gooId = this.$route.query.goid
// this.goId = gooId
this.GUID = id
if (id) {
return getCompanyDetail(id)
.then(res => {
console.log(res)
this.form.setFieldsValue(res)
})
.catch(err => {})
}
//获取所有权限
// getManageGroupList()
// .then(res => {
// console.log(res)
// this.grouplist = res.info
// })
// .catch(err => {})
},
methods: {
// checkboxGroup处理
checkRadio(value) {
if (value) {
return value.toString()
}
},
//time
DateCheck(value) {
if (value || value != null || value != '') {
console.log(value)
return moment(value, 'YYYY-MM-DD')
}
},
// checkRadio(value) {
// if (value == null || value == '') {
// return '0'
// } else {
// return value.toString()
// }
// },
handleSubmit() {
console.log(validateFields)
const {
form: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
console.log(values)
if (!err) {
console.log(err)
const EminformanParams = { ...values }
addDistributionManage(EminformanParams)
this.$router.push({ path: '/delivery/distributionManage' })
}
})
},
handleSubmit1() {
let guid = this.GUID
const {
form: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
if (!err) {
const CompanyModify = Object.assign({ ...values }, { GUID: guid })
// if (CompanyModify.CONTACTBIRTH_DATE) {
// CompanyModify.CONTACTBIRTH_DATE = CompanyModify.CONTACTBIRTH_DATE.format('YYYY-MM-DD')
// }
modifyCompanyDetail(EminformanModify)
this.$router.push({ path: '/delivery/distributionManage' })
}
})
},
goBack() {
this.$router.push({ path: '/delivery/distributionManage' })
}
}
}
</script>
......@@ -3,7 +3,7 @@
<a-card style="margin-bottom:10px">
<div class="table-operator">
<a-button-group>
<a-button type='primary' icon='plus' @click="goEdit(1)">添加管理员</a-button>
<a-button type="primary" icon="plus" @click="goEdit()">添加配送方式</a-button>
</a-button-group>
</div>
<s-table
......@@ -15,13 +15,30 @@
:data="loadData"
:showPagination="pagination"
>
<span slot="action" slot-scope="text, record">
<span slot="switchAction" slot-scope="">
<template>
<a @click="handleEdit(record)">角色分配</a>
<!-- <a-divider type="vertical" /> -->
<!-- <a-popconfirm title="是否要删除此行?" @confirm="remove(record.ID)">
<a>删除</a>
</a-popconfirm> -->
<a-row type="flex" justify="start" align="middle">
<a-col><a-switch checkedChildren="开" unCheckedChildren="关" defaultChecked/></a-col>
<a-col><a-divider type="vertical"/></a-col>
<a-col><a-switch checkedChildren="开" unCheckedChildren="关" defaultChecked/></a-col>
</a-row>
</template>
</span>
<span slot="action" slot-scope="">
<template>
<a-row type="flex" justify="start" align="middle">
<a-col>
<a @click="goEdit(record.GUID)">编辑</a>
</a-col>
<!-- <a-col>
<a-divider type="vertical"/>
</a-col>
<a-col>
<a-popconfirm title="是否要删除此行?" @confirm="remove(record.ID)">
<a>删除</a>
</a-popconfirm>
</a-col> -->
</a-row>
</template>
</span>
</s-table>
......@@ -32,9 +49,9 @@
// , addMenu, updateMenu, deleteMenu
import moment from 'moment'
import { STable } from '@/components'
import { getMangeList } from '@/api/authority'
import { getTransportMethod } from '@/api/delivery'
export default {
name:"authority",
name: 'delivery',
components: {
STable
},
......@@ -49,21 +66,14 @@ export default {
form: this.$form.createForm(this),
columns: [
{
title: '管理员姓名',
title: '名称',
dataIndex: 'NAME'
},
{
title: '手机号',
dataIndex: 'MOBILEPHONE'
},
{
title: '创建时间',
dataIndex: 'CREATE_DATE'
},
{
title: '角色',
dataIndex: 'ROLENAME'
title: '开启关闭配送方式',
dataIndex: 'switchAction',
width: '200px',
scopedSlots: { customRender: 'switchAction' }
},
{
title: '操作',
......@@ -72,30 +82,37 @@ export default {
scopedSlots: { customRender: 'action' }
}
],
// listData:[],
pagination:false,
listData:[],
pagination: false,
// 加载数据方法 必须为 Promise 对象
loadData: parameter => {
console.log('shujujiazai')
return getMangeList(Object.assign(parameter, this.queryParam)).then(res => {
return getTransportMethod().then(res => {
console.log('1212121')
console.log(res)
// this.listData = res
// console.log(this.listData)
// res.data=this.listData
this.listData = res
console.log(this.listData)
res.data=this.listData
return res
})
},
selectedRowKeys: [],
selectedRows: [],
modalNow: 1
}
},
methods: {
goEdit (GUID='') {
if(GUID){
this.$router.push({path:'/delivery/details/distributionDetail',query:{GUID:GUID}})
// this.$router.push({path:'/authority/details/Manage_editor',query:{goid:1}})
}else{
// console.log(value)
this.$router.push({path:'/delivery/details/distributionDetail'})
}
},
}
}
</script>
<style>
......
......@@ -3,7 +3,7 @@
<a-card style="margin-bottom:10px">
<div class="table-operator">
<a-button-group>
<a-button type='primary' icon='plus' @click="goEdit(1)">添加快递</a-button>
<a-button type='primary' icon='plus' @click="goEdit()">添加快递</a-button>
</a-button-group>
</div>
<s-table
......@@ -13,11 +13,11 @@
rowKey="GUID"
:columns="columns"
:data="loadData"
:showPagination="pagination"
showPagination="auto"
>
<span slot="action" slot-scope="text, record">
<template>
<a @click="handleEdit(record)">编辑</a>
<a @click="goEdit(record.GUID)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="是否要删除此行?" @confirm="remove(record.ID)">
<a>删除</a>
......@@ -53,49 +53,26 @@ export default {
dataIndex: 'CODE'
},
{
title: '名称',
title: '配送方式名称',
dataIndex: 'NAME'
},
{
title: '描述',
dataIndex: 'DESCRIPTION'
title: '手机号',
dataIndex: 'PHONE'
},
{
title: '是否启用',
dataIndex: 'STATE'
},
{
title: '是否支持线下付款',
dataIndex: 'IS_UNDERLINE_PAY'
},
{
title: '积分商城中是否启用',
dataIndex: 'POINTS_STATE'
},
{
title: '小程序中是否启用',
dataIndex: 'ROMENS_RENT_STATE'
},
{
title: '定时达时间间隔',
dataIndex: 'DSDINTERVAL'
},
{
title: '配送方式类型',
dataIndex: 'TRANSPOR_TYPE'
},
{
title: '额外费用',
dataIndex: 'EXTRA_MONEY'
title: '排序',
dataIndex: 'SORT'
},
{
title: '配送时间',
dataIndex: 'DELIVERY_TIME'
title: '描述',
dataIndex: 'DESCRIPTION'
},
{
title: '排序序号',
dataIndex: 'ORDER_INDEX'
title: '是否默认',
dataIndex: 'IS_DEFAULT'
},
{
......@@ -105,17 +82,20 @@ export default {
scopedSlots: { customRender: 'action' }
}
],
listData:[],
pagination:false,
// listData:[],
// pagination:false,
// 加载数据方法 必须为 Promise 对象
loadData: parameter => {
console.log('shujujiazai')
return getDistributionModeList(Object.assign(parameter, this.queryParam)).then(res => {
console.log('1212121')
console.log(res)
this.listData = res
console.log(this.listData)
res.data=this.listData
console.log(res)
res.pageSize = res._meta.perPage
res.page = res._meta.currentPage
res.totalPage = res._meta.pageCount
res.totalCount = res._meta.totalCount
// res.data = []
// res.data = res.userdepartment
console.log(res.data)
return res
})
},
......@@ -126,6 +106,16 @@ export default {
}
},
methods: {
goEdit (GUID='') {
if(GUID){
this.$router.push({path:'/delivery/details/companyDetail',query:{GUID:GUID}})
// this.$router.push({path:'/authority/details/Manage_editor',query:{goid:1}})
}else{
// console.log(value)
this.$router.push({path:'/delivery/details/companyDetail'})
}
},
}
......
......@@ -83,7 +83,7 @@
label="门店坐标"
:labelCol="labelCol"
:wrapperCol="wrapperCol">
<div id="components-button-demo-button-group">
<a-row>
<a-col :span="12">
<a-input-group compact>
<a-input
......@@ -94,17 +94,7 @@
<a-button type="primary" style="width:20%">LAT</a-button>
</a-input-group>
</a-col>
<a-col :span="12">
<a-input-group compact>
<a-input
style="width:50%"
v-decorator="['LNG']"
placeholder="请输入坐标"
/>
<a-button type="primary" style="width:20%">LNG</a-button>
</a-input-group>
</a-col>
</div>
<a-row>
</a-form-item>
<a-form-item
label="是否积分兑换门店"
......
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