巷道管理删除接口联调

merge-requests/1/head
张鑫 5 years ago
parent 8e016af8ab
commit 27743f1faf

@ -1,4 +1,4 @@
export default {
export default {
getStreetList: {
method: "POST",
url: "/street/page",
@ -14,6 +14,11 @@ export default {
url: "/street",
name: "编辑巷道"
},
// deleteStreet: {
// method: "DELETE",
// url: "/street",
// name: "删除巷道"
// },
queryList: {
url: '/order/list',
name: '查询',

@ -98,7 +98,7 @@ export default {
.table{
background: #ffffff;
margin: 8px 20px;
height: 900px;
height: calc(100vh - 190px);
padding:20px;
}
}

@ -10,6 +10,8 @@ import api from './plugins/axios/index'
Vue.config.productionTip = false
Vue.prototype.$utils = utils
Vue.prototype.$api = api
// import axios from 'axios'
// Vue.prototype.$axios = axios
new Vue({
router,
store,

@ -111,5 +111,8 @@ export default {
.collapsedClose{
margin-left: 80px;
}
.ant-table td {
white-space: nowrap;
}
}
</style>

@ -48,7 +48,7 @@
<script>
import Model from "./model.vue";
import Model from "./model.vue"
const columns = [
{
title: '巷道名称',
@ -88,7 +88,14 @@ export default {
pageNum:1,
pageSize:10,
data: [],
pagination: {},
pagination:{
total:0,
defaultPageSize:10, //
showTotal: total => `${total} 条数据`, //
showSizeChanger:true, //
pageSizeOptions: ['10', '20', '30'],
onShowSizeChange:(current, pageSize)=>this.pageSize = pageSize //
},
loading: false,
columns,
visible:false,
@ -100,14 +107,27 @@ export default {
this.handleGetStreetList()
},
methods: {
handleGetStreetList(){
handleGetStreetList(pagination) {
console.log(pagination)
if(pagination){
this.pagination.current = pagination.current;
this.pagination.pageSize = pagination.pageSize;
this.pageNum = pagination.current;
this.pageSize = pagination.pageSize;
}
this.request();
},
request(){
this.$api.httpApi.getStreetList({
data: {
pageNum:this.pageNum,
pageSize:this.pageSize,
}
}).then(res => {
const pagination = { ...this.pagination };
pagination.total = res.data.total;
this.data = res.data.list;
this.pagination = pagination;
});
},
showModel(type,data){
@ -128,6 +148,18 @@ export default {
this.visible = visible
this.modelData=data
},
delDosage(data){
console.log(data.id)
var id=data.id
this.$axios.delete('/street/'+id, {
data: {}
}).then(res => {
if(res.code==200){
this.$message.success('删除巷道成功');
this.handleGetStreetList()
}
})
}
},
components:{
Model

@ -146,10 +146,10 @@
placeholder="选择球机"
>
<a-select-option value="0">
单伸
球机1
</a-select-option>
<a-select-option value="1">
双伸
球机2
</a-select-option>
</a-select>
</a-form-item>
@ -161,10 +161,10 @@
placeholder="选择球机"
>
<a-select-option value="0">
单伸
球机3
</a-select-option>
<a-select-option value="1">
双伸
球机4
</a-select-option>
</a-select>
</a-form-item>
@ -198,6 +198,7 @@ export default {
this.mdata=newVal
this.leftType=newVal.leftType
this.rightType=newVal.rightType
this.id = newVal.id
// console.log('watch')
this.$nextTick(()=>{ //this.$nextTick
this.form.setFieldsValue({ //setFieldsValue form
@ -234,6 +235,7 @@ export default {
form: this.$form.createForm(this, { name: 'dynamic_rule' }),
leftType:'',
rightType:'',
id:'',
mdata:[]
};
},
@ -250,9 +252,7 @@ export default {
console.log(this.title)
if(this.title=='新增巷道'){
this.$api.httpApi.addStreet({
data: {
values
}
data:values
}).then(res => {
if(res.code==200){
this.$emit('sure',false)
@ -260,10 +260,25 @@ export default {
}
});
}else if(this.title=='编辑巷道'){
this.$api.httpApi.addStreet({
data: {
values
}
values.id = this.id
switch (values.leftType) {
case '单伸':
values.leftType='0'
break;
case '双伸':
values.leftType='1'
break;
}
switch (values.rightType) {
case '单伸':
values.rightType='0'
break;
case '双伸':
values.rightType='1'
break;
}
this.$api.httpApi.editStreet({
data:values
}).then(res => {
if(res.code==200){
this.$emit('sure',false)

Loading…
Cancel
Save