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

服务类目

parent c809425b
...@@ -39,7 +39,7 @@ export function getProvincialList(parameter) { ...@@ -39,7 +39,7 @@ export function getProvincialList(parameter) {
params: parameter params: parameter
}) })
} }
// 新增运费模板 // 新增配送价格
export function addDelivery (parameter) { export function addDelivery (parameter) {
return axios({ return axios({
url: 'transport/transport-settings/transport-fee-add', url: 'transport/transport-settings/transport-fee-add',
...@@ -63,6 +63,21 @@ export function getAllCity (parameter) { ...@@ -63,6 +63,21 @@ export function getAllCity (parameter) {
params: parameter params: parameter
}) })
} }
// 更新配送价格
export function modifyDelivery (parameter) {
return axios({
url: 'transport/transport-settings/transport-fee-update',
method: 'put',
data: parameter
})
}
// 删除配送价格
export function deleteDelivery (parameter) {
return axios({
url: 'transport/transport-settings/transport-fee-del?GUID='+parameter,
method: 'delete'
})
}
/** /**
......
...@@ -188,9 +188,9 @@ ...@@ -188,9 +188,9 @@
<!-- fixed footer toolbar --> <!-- fixed footer toolbar -->
<footer-tool-bar :style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}"> <footer-tool-bar :style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}">
<!-- 新建 --> <!-- 新建 -->
<a-button @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交</a-button> <a-button v-if="editDetails" @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交</a-button>
<!-- 编辑 --> <!-- 编辑 -->
<!-- <a-button @click.stop.prevent="handleSubmit1" 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-button @click="goBack" style="margin-left: 8px">返回</a-button>
</footer-tool-bar> </footer-tool-bar>
<a-modal title="选择门店" :width="800" :destroyOnClose="destroyOnClose" v-model="visible" @ok="handleOk()"> <a-modal title="选择门店" :width="800" :destroyOnClose="destroyOnClose" v-model="visible" @ok="handleOk()">
...@@ -231,7 +231,7 @@ import moment from 'moment' ...@@ -231,7 +231,7 @@ import moment from 'moment'
import FooterToolBar from '@/components/FooterToolbar' import FooterToolBar from '@/components/FooterToolbar'
import { mixin, mixinDevice } from '@/utils/mixin' import { mixin, mixinDevice } from '@/utils/mixin'
import { STable } from '@/components' import { STable } from '@/components'
import { getTransportList,getProvincialList,addDelivery,getEditDetails,getAllCity } from '@/api/delivery' import { getTransportList,getProvincialList,addDelivery,getEditDetails,getAllCity,modifyDelivery } from '@/api/delivery'
import { getUListUserGroup } from '@/api/userstaff' import { getUListUserGroup } from '@/api/userstaff'
import { loadAddress } from '@/api/store' import { loadAddress } from '@/api/store'
...@@ -252,6 +252,7 @@ export default { ...@@ -252,6 +252,7 @@ export default {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 12 } sm: { span: 12 }
}, },
editDetails:true,//新建或者编辑,默认新建
formCheck:this.$form.createForm(this), formCheck:this.$form.createForm(this),
visible:false, visible:false,
destroyOnClose:true, destroyOnClose:true,
...@@ -327,12 +328,16 @@ export default { ...@@ -327,12 +328,16 @@ export default {
this.getAllC() this.getAllC()
var goId=this.$route.query.goid; var goId=this.$route.query.goid;
if(goId==0){ if(goId==0){
this.editDetails=false;
this.getDetails(this.$route.query.GUID) this.getDetails(this.$route.query.GUID)
}else{
this.editDetails=true;
} }
}, },
methods:{ methods:{
// 提交(新建) // 提交(新建)
handleSubmit(){ handleSubmit(){
var that=this;
const { modalForm: { validateFields } } = this; const { modalForm: { validateFields } } = this;
validateFields({ force: true }, (err, values) => { validateFields({ force: true }, (err, values) => {
if (!err) { if (!err) {
...@@ -348,11 +353,20 @@ export default { ...@@ -348,11 +353,20 @@ export default {
deliveryData.LIMIT_MEMBER_GROUP_GUID=deliveryData.LIMIT_MEMBER_GROUP_GUID.join(',') deliveryData.LIMIT_MEMBER_GROUP_GUID=deliveryData.LIMIT_MEMBER_GROUP_GUID.join(',')
} }
if(this.modalTree.checkedKeys){ if(this.modalTree.checkedKeys){
this.modalTree.checkedKeys.map(function(item,index){ deliveryData.SELECT_AREA=[];
this.modalTree.checkedKeys.forEach((item,index) => {
if(item=='P0'){
this.modalTree.checkedKeys.splice(index,1)
}
if(item.split('').includes('P')){ if(item.split('').includes('P')){
that.modalTree.checkedKeys.splice(index,1) this.modalTree.checkedKeys.splice(index,1)
} }
}) })
// this.modalTree.checkedKeys.map(function(item,index){
// if(item.split('').includes('P')){
// that.modalTree.checkedKeys.splice(index,1)
// }
// })
deliveryData.SELECT_AREA=this.modalTree.checkedKeys.join(',') deliveryData.SELECT_AREA=this.modalTree.checkedKeys.join(',')
} }
if(this.tableData.length>0){ if(this.tableData.length>0){
...@@ -365,11 +379,65 @@ export default { ...@@ -365,11 +379,65 @@ export default {
deliveryData.BRANCHES_INFO='' deliveryData.BRANCHES_INFO=''
} }
console.log(deliveryData) console.log(deliveryData)
// addDelivery(deliveryData).then(res => { addDelivery(deliveryData).then(res => {
// this.goBack(); this.goBack();
// }).catch(err => { }).catch(err => {
// }) })
}
})
},// 提交(编辑)
handleSubmit1(){
var that=this;
const { modalForm: { validateFields } } = this;
const guidData={
GUID:this.$route.query.GUID
}
validateFields({ force: true }, (err, values) => {
if (!err) {
const deliveryData = Object.assign({ ...values },guidData);
for(let item in deliveryData){
if(deliveryData[item]===true){
deliveryData[item]='1'
}else if(deliveryData[item]===false){
deliveryData[item]='0'
}
}
if(deliveryData.LIMIT_MEMBER_GROUP_GUID){
deliveryData.LIMIT_MEMBER_GROUP_GUID=deliveryData.LIMIT_MEMBER_GROUP_GUID.join(',')
}
if(this.modalTree.checkedKeys){
deliveryData.SELECT_AREA=[];
this.modalTree.checkedKeys.forEach((item,index) => {
if(item=='P0'){
this.modalTree.checkedKeys.splice(index,1)
}
if(item.split('').includes('P')){
this.modalTree.checkedKeys.splice(index,1)
}
})
// this.modalTree.checkedKeys.map(function(item,index){
// if(item.split('').includes('P')){
// that.modalTree.checkedKeys.splice(index,1)
// }
// })
deliveryData.SELECT_AREA=this.modalTree.checkedKeys.join(',')
}
if(this.tableData.length>0){
const BRANCHES_INFO=[]
this.tableData.forEach(item => {
BRANCHES_INFO.push(item.GUID)
})
deliveryData.BRANCHES_INFO=BRANCHES_INFO.join(',')
}else{
deliveryData.BRANCHES_INFO=''
}
console.log(deliveryData)
modifyDelivery(deliveryData).then(res => {
this.goBack();
}).catch(err => {
})
} }
}) })
}, },
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<script> <script>
import moment from 'moment' import moment from 'moment'
import { STable } from '@/components' import { STable } from '@/components'
import { getDeliveryList,getTransportList } from '@/api/delivery' import { getDeliveryList,getTransportList,deleteDelivery } from '@/api/delivery'
export default { export default {
name:"delivery", name:"delivery",
...@@ -111,6 +111,9 @@ export default { ...@@ -111,6 +111,9 @@ export default {
} }
} }
}, },
mounted(){
this.$refs.table.refresh();
},
methods:{ methods:{
goEdit(value){ goEdit(value){
if(value==1){ if(value==1){
...@@ -119,6 +122,14 @@ export default { ...@@ -119,6 +122,14 @@ export default {
this.$router.push({path:'/delivery/deliveryDetails',query:{goid:0,GUID:value.GUID}}) this.$router.push({path:'/delivery/deliveryDetails',query:{goid:0,GUID:value.GUID}})
} }
}, },
remove(value){
deleteDelivery(value).then(res => {
this.$refs.table.refresh();
this.$message.success(res.message)
}).catch(err => {
})
}
} }
} }
</script> </script>
\ No newline at end of file
...@@ -155,62 +155,10 @@ export default { ...@@ -155,62 +155,10 @@ export default {
} }
}, },
handleEdit(value) { handleEdit(value) {
this.visible = true
var that = this
if(value==1){ if(value==1){
// 新建 this.$router.push({path:'/storedc/details/branchservice_editor',query:{goid:1}})
this.modalNow=1;
}else{ }else{
// 编辑 this.$router.push({path:'/storedc/details/branchservice_editor',query:{goid:0,GUID:value.CODE}})
this.modalNow=0;
getScategorymgDetails(value.CODE)
.then(res => {
// this.radioVal = res.data[0]
console.log(res.data[0])
// this.modalForm.initialValue(res)
this.$nextTick(() => {
this.GUID = res.data[0].GUID
this.modalForm.setFieldsValue(res.data[0])
})
})
.catch(err => {})
}
},
handleadd() {
this.$router.push({ path: '/storedc/branchservice_add' })
},
handleOk() {
if(this.modalNow==1){
const {
modalForm: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
if (!err) {
this.visible = false
const ScategorymgParams = { ...values }
ScategorymgParams.CREATE_TIME=ScategorymgParams.CREATE_TIME.format('YYYY-MM-DD HH:mm:ss')
addScategorymg(ScategorymgParams)
this.$refs.table.refresh(true)
}
})
}else{
let GUID = this.GUID
const {
modalForm: { validateFields }
} = this
validateFields({ force: true }, (err, values) => {
if (!err) {
const ScategorymgDetails = Object.assign({ ...values }, { GUID: GUID })
ScategorymgDetails.CREATE_TIME=ScategorymgDetails.CREATE_TIME.format('YYYY-MM-DD HH:mm:ss')
modifyScategorymgDetails(ScategorymgDetails)
.then(res => {
this.visible = false
// this.whichOptions=1;
this.$refs.table.refresh(true)
})
.catch(err => {})
}
})
} }
}, },
remove(key) { remove(key) {
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</a-form-item> </a-form-item>
<a-form-item :wrapperCol="{ span: 24 }" style="text-align: center"> <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
<a-button v-if="goId == 1" @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交</a-button> <a-button v-if="goId == 1" @click.stop.prevent="handleSubmit" htmlType="submit" type="primary">提交1</a-button>
<a-button v-else @click.stop.prevent="handleSubmit1()" 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-button @click="goBack" style="margin-left: 8px">返回</a-button>
</a-form-item> </a-form-item>
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
methods: { methods: {
// 时间处理 // 时间处理
DateCheck(value){ DateCheck(value){
if(value || value!=null || value!=""){ if(value && value!=null && value!="" && value!="undefined"){
return moment(value,'YYYY-MM-DD HH:mm:ss') return moment(value,'YYYY-MM-DD HH:mm:ss')
} }
}, },
...@@ -128,6 +128,7 @@ export default { ...@@ -128,6 +128,7 @@ export default {
validateFields({ force: true }, (err, values) => { validateFields({ force: true }, (err, values) => {
if (!err) { if (!err) {
const ScategorymgParams = { ...values } const ScategorymgParams = { ...values }
ScategorymgParams.CREATE_TIME=ScategorymgParams.CREATE_TIME.format("YYYY-MM-DD HH:mm:ss");
addScategorymg(ScategorymgParams) addScategorymg(ScategorymgParams)
this.$router.push({ path: '/storedc/scategorymg' }) this.$router.push({ path: '/storedc/scategorymg' })
} }
......
...@@ -156,6 +156,7 @@ ...@@ -156,6 +156,7 @@
<a-form-item <a-form-item
:labelCol='labelCol' :labelCol='labelCol'
:wrapperCol='wrapperCol' :wrapperCol='wrapperCol'
hidden
> >
<a-input <a-input
hidden hidden
...@@ -434,6 +435,7 @@ export default { ...@@ -434,6 +435,7 @@ export default {
console.log(key) console.log(key)
deleteEvaluate(key).then(res => { deleteEvaluate(key).then(res => {
this.$refs.table.refresh(); this.$refs.table.refresh();
this.$message.success(res.message)
}).catch(err => { }).catch(err => {
}) })
...@@ -467,7 +469,10 @@ export default { ...@@ -467,7 +469,10 @@ export default {
// this.whichOptions=1; // this.whichOptions=1;
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}).catch(err => { }).catch(err => {
this.$notification['error']({
message: err.response.data.message,
description: err.response.data.message
})
}) })
} }
}) })
......
...@@ -107,10 +107,9 @@ export default { ...@@ -107,10 +107,9 @@ export default {
} }
}, },
remove ( key ) { remove ( key ) {
console.log(key)
deleteUserGroup(key).then(res => { deleteUserGroup(key).then(res => {
console.log('已删除')
this.$refs.table.refresh(); this.$refs.table.refresh();
this.$message.success('删除成功!')
}).catch(err => { }).catch(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