|
|
@ -12,35 +12,44 @@ |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="省份"> |
|
|
|
<el-form-item label="省份"> |
|
|
|
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()"> |
|
|
|
<el-select v-model="form.provinces" clearable placeholder="请选择省份" |
|
|
|
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> |
|
|
|
@change="getCity()" @clear="clearprovince()"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in provinceList" :key="index" |
|
|
|
|
|
|
|
:label="item.provinceName" :value="item.provinceId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="城市"> |
|
|
|
<el-form-item label="城市"> |
|
|
|
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="getData()"> |
|
|
|
<el-select v-model="form.city" clearable placeholder="请选择城市" |
|
|
|
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> |
|
|
|
:disabled="form.provinces ? false : true" @change="getData()"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in cityList" :key="index" |
|
|
|
|
|
|
|
:label="item.cityName" :value="item.cityId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="订单类型"> |
|
|
|
<el-form-item label="订单类型"> |
|
|
|
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型" @change="getData()"> |
|
|
|
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型" |
|
|
|
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option> |
|
|
|
@change="getData()"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in orderTypeList" :key="index" |
|
|
|
|
|
|
|
:label="item.name" :value="item.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="订单状态"> |
|
|
|
<el-form-item label="订单状态"> |
|
|
|
<el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" @change="getData()"> |
|
|
|
<el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" |
|
|
|
<el-option v-for="(item,index) in orderStatusList" :key="index" :label="item.name" :value="item.value"></el-option> |
|
|
|
@change="getData()"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in orderStatusList" :key="index" |
|
|
|
|
|
|
|
:label="item.name" :value="item.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="keyword" @keyup.enter.native="onSearch" clearable></el-input> |
|
|
|
<el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" |
|
|
|
|
|
|
|
v-model="keyword" @keyup.enter.native="onSearch" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
@ -57,12 +66,15 @@ |
|
|
|
<span>订单列表</span> |
|
|
|
<span>订单列表</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" round class="mag" @click="addOrder()">新建订单</el-button> |
|
|
|
<el-button type="primary" size="small" round class="mag" @click="addOrder()">新建订单 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> |
|
|
|
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="orderData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
|
|
|
<el-table :data="orderData" class="table" stripe header-align="center" |
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
@selection-change="handleSelectionChange" :row-key="getRowKeys"> |
|
|
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" |
|
|
|
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="orderNumber" label="订单编号" align="center"> |
|
|
|
<el-table-column prop="orderNumber" label="订单编号" align="center"> |
|
|
@ -83,15 +95,20 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" v-if="scope.row.isDel!==1" @click="handle('edit',scope.row)">{{scope.row.orderStatus==='已完成'?'修改':'处理'}}</el-button> |
|
|
|
<el-button type="text" v-if="scope.row.isDel!==1" @click="handle('edit',scope.row)"> |
|
|
|
|
|
|
|
{{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }} |
|
|
|
|
|
|
|
</el-button> |
|
|
|
<el-button type="text" @click="handle('watch',scope.row)">查看</el-button> |
|
|
|
<el-button type="text" @click="handle('watch',scope.row)">查看</el-button> |
|
|
|
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
<el-button type="text" v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1" @click="handle('renew',scope.row)">续费</el-button> |
|
|
|
<el-button type="text" v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1" |
|
|
|
|
|
|
|
@click="handle('renew',scope.row)">续费 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="pageNo" :total="totals"> |
|
|
|
<el-pagination background layout="total, prev, pager, next" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" :current-page="pageNo" :total="totals"> |
|
|
|
</el-pagination> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
@ -105,57 +122,57 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
provinces: '', |
|
|
|
provinces: "", |
|
|
|
city: '', |
|
|
|
city: "", |
|
|
|
orderType: '', |
|
|
|
orderType: "", |
|
|
|
orderStatus: '' |
|
|
|
orderStatus: "" |
|
|
|
}, |
|
|
|
}, |
|
|
|
keyword: '', |
|
|
|
keyword: "", |
|
|
|
orderData: [], |
|
|
|
orderData: [], |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
provinceList: this.$store.state.provinceList, |
|
|
|
provinceList: this.$store.state.provinceList, |
|
|
|
cityList: [], |
|
|
|
cityList: [], |
|
|
|
orderTypeList: [{ |
|
|
|
orderTypeList: [{ |
|
|
|
name: '正式', |
|
|
|
name: "正式", |
|
|
|
value: 1 |
|
|
|
value: 1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '试用', |
|
|
|
name: "试用", |
|
|
|
value: 2 |
|
|
|
value: 2 |
|
|
|
}], |
|
|
|
}], |
|
|
|
orderStatusList: [{ |
|
|
|
orderStatusList: [{ |
|
|
|
name: '待发货', |
|
|
|
name: "待发货", |
|
|
|
value: 0 |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '已完成', |
|
|
|
name: "已完成", |
|
|
|
value: 1 |
|
|
|
value: 1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '已取消', |
|
|
|
name: "已取消", |
|
|
|
value: 2 |
|
|
|
value: 2 |
|
|
|
}], |
|
|
|
}], |
|
|
|
pageNo: 1, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
totals: 1, |
|
|
|
totals: 1, |
|
|
|
setTime:'', |
|
|
|
setTime: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function(val) { |
|
|
|
keyword: function(val) { |
|
|
|
clearTimeout(this.setTime) |
|
|
|
clearTimeout(this.setTime); |
|
|
|
this.setTime = setTimeout(() => { |
|
|
|
this.setTime = setTimeout(() => { |
|
|
|
this.onSearch() |
|
|
|
this.onSearch(); |
|
|
|
},500) |
|
|
|
}, 500); |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.getData() |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
test(val) { |
|
|
|
test(val) { |
|
|
|
if (val.length > 5) { |
|
|
|
if (val.length > 5) { |
|
|
|
val = 5 |
|
|
|
val = 5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
@ -167,58 +184,62 @@ export default { |
|
|
|
orderType: this.form.orderType, |
|
|
|
orderType: this.form.orderType, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
provinceId: this.form.provinces, |
|
|
|
provinceId: this.form.provinces |
|
|
|
} |
|
|
|
}; |
|
|
|
this.$post(this.api.orderList, data).then(res => { |
|
|
|
this.$post(this.api.orderList, data).then(res => { |
|
|
|
res.orderPage.orders.forEach(e => { |
|
|
|
res.orderPage.orders.forEach(e => { |
|
|
|
e.orderType = this.orderTypeFn(e.orderType) |
|
|
|
e.orderType = this.orderTypeFn(e.orderType); |
|
|
|
e.orderStatus = this.orderStatusFn(e.orderStatus) |
|
|
|
e.orderStatus = this.orderStatusFn(e.orderStatus); |
|
|
|
e.orderNature = this.orderNatureFn(e.orderNature) |
|
|
|
e.orderNature = this.orderNatureFn(e.orderNature); |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.orderData = res.orderPage.orders |
|
|
|
this.orderData = res.orderPage.orders; |
|
|
|
this.totals =res.orderPage.total |
|
|
|
this.totals = res.orderPage.total; |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 清除省份 |
|
|
|
// 清除省份 |
|
|
|
clearprovince() { |
|
|
|
clearprovince() { |
|
|
|
this.form.city = '' |
|
|
|
this.form.city = ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取城市 |
|
|
|
// 获取城市 |
|
|
|
getCity() { |
|
|
|
getCity() { |
|
|
|
this.clearprovince() |
|
|
|
this.clearprovince(); |
|
|
|
this.getCityData() |
|
|
|
this.getCityData(); |
|
|
|
this.pageNo = 1 |
|
|
|
this.pageNo = 1; |
|
|
|
this.getData() |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCityData() { |
|
|
|
getCityData() { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
provinceId: this.form.provinces |
|
|
|
provinceId: this.form.provinces |
|
|
|
} |
|
|
|
}; |
|
|
|
this.$get(this.api.queryCity, data).then(res => { |
|
|
|
this.$get(this.api.queryCity, data).then(res => { |
|
|
|
this.cityList = res.list |
|
|
|
this.cityList = res.list; |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
addOrder() { |
|
|
|
addOrder() { |
|
|
|
this.$store.commit("systemData", { order_id : ''}); |
|
|
|
this.$store.commit("systemData", { order_id: "" }); |
|
|
|
this.$router.push('/addorder'); |
|
|
|
this.$router.push("/addorder"); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handle(val, row) { |
|
|
|
handle(val, row) { |
|
|
|
this.$router.push('/addorder?'+val+'='+row.orderId); |
|
|
|
this.$router.push("/addorder?" + val + "=" + row.orderId); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除订单 |
|
|
|
// 删除订单 |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete(row) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: 'warning' |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
var arr = [] |
|
|
|
var arr = []; |
|
|
|
arr.push(row.orderId) |
|
|
|
arr.push(row.orderId); |
|
|
|
this.$post(this.api.orderDelete, { ids: arr }).then(res => { |
|
|
|
this.$post(this.api.orderDelete, { ids: arr }).then(res => { |
|
|
|
this.$message.success('删除成功'); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.getData() |
|
|
|
this.getData(); |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
.catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 续签 |
|
|
|
// 续签 |
|
|
|
handleRenew(row) { |
|
|
|
handleRenew(row) { |
|
|
@ -231,29 +252,31 @@ export default { |
|
|
|
if (val.length > 0) { |
|
|
|
if (val.length > 0) { |
|
|
|
this.multipleSelection = val.map(e => e.orderId); |
|
|
|
this.multipleSelection = val.map(e => e.orderId); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.multipleSelection = [] |
|
|
|
this.multipleSelection = []; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
delAllSelection() { |
|
|
|
delAllSelection() { |
|
|
|
if(this.multipleSelection.length != ''){ |
|
|
|
if (this.multipleSelection.length != "") { |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: 'warning' |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => { |
|
|
|
this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => { |
|
|
|
this.multipleSelection = []; |
|
|
|
this.multipleSelection = []; |
|
|
|
this.$message.success('删除成功'); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.getData() |
|
|
|
this.getData(); |
|
|
|
}).catch(err => {}); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => {}); |
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message.error('请先选择订单 !'); |
|
|
|
this.$message.error("请先选择订单 !"); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onSearch() { |
|
|
|
onSearch() { |
|
|
|
this.pageNo = 1 |
|
|
|
this.pageNo = 1; |
|
|
|
this.getData() |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.pageNo = val; |
|
|
|
this.pageNo = val; |
|
|
@ -261,7 +284,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择客户触发 |
|
|
|
// 选择客户触发 |
|
|
|
gotoClient() { |
|
|
|
gotoClient() { |
|
|
|
this.$router.push('') |
|
|
|
this.$router.push(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|