|
@@ -2,44 +2,64 @@
|
|
<template>
|
|
<template>
|
|
<div class="addInwardPlan">
|
|
<div class="addInwardPlan">
|
|
<page-title>新增计划</page-title>
|
|
<page-title>新增计划</page-title>
|
|
- <div class="carrier form">
|
|
|
|
- <el-form class="demo-form-inline" label-width="80px" label-position="left">
|
|
|
|
- <el-form-item label="承运商">
|
|
|
|
- <el-autocomplete
|
|
|
|
- class="inline-input"
|
|
|
|
- v-model="state2"
|
|
|
|
- :fetch-suggestions="querySearch"
|
|
|
|
- placeholder="请输入承运商名称"
|
|
|
|
- :trigger-on-focus="false"
|
|
|
|
- @select="handleSelect"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="{ item }">
|
|
|
|
- <div class="name">{{ item.value }}</div>
|
|
|
|
- </template>
|
|
|
|
- </el-autocomplete>
|
|
|
|
- </el-form-item>
|
|
|
|
- <div class="truckNum">
|
|
|
|
- <el-form class="demo-form-inline" label-width="80px" label-position="left">
|
|
|
|
- <el-form-item label="车数">
|
|
|
|
- <el-input v-model="planTruckNumber" placeholder="非必填" class="input"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </div>
|
|
|
|
-</el-form>
|
|
|
|
-</div>
|
|
|
|
|
|
+ <div class="carrier form">
|
|
|
|
+ <el-form
|
|
|
|
+ class="demo-form-inline"
|
|
|
|
+ label-width="80px"
|
|
|
|
+ label-position="left"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="承运商">
|
|
|
|
+ <el-autocomplete
|
|
|
|
+ class="inline-input"
|
|
|
|
+ v-model="state2"
|
|
|
|
+ :fetch-suggestions="querySearch"
|
|
|
|
+ placeholder="请输入承运商名称"
|
|
|
|
+ :trigger-on-focus="false"
|
|
|
|
+ @select="handleSelect"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
+ <div class="name">{{ item.value }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-autocomplete>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <div class="truckNum">
|
|
|
|
+ <el-form
|
|
|
|
+ class="demo-form-inline"
|
|
|
|
+ label-width="80px"
|
|
|
|
+ label-position="left"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="车数">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="planTruckNumber"
|
|
|
|
+ placeholder="非必填"
|
|
|
|
+ class="input"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <mergeRowTable v-bind.sync="first" @radio-change="currentRadioChange" ref="table">
|
|
|
|
- <el-table-column fixed="right" label="操作" width="120">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button type="text" size="mini" @click="deleteRequirement(scope)">
|
|
|
|
- 拒绝需求
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </mergeRowTable>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <mergeRowTable
|
|
|
|
+ v-bind.sync="first"
|
|
|
|
+ @radio-change="currentRadioChange"
|
|
|
|
+ ref="table"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="120">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="deleteRequirement(scope)"
|
|
|
|
+ >
|
|
|
|
+ 拒绝需求
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </mergeRowTable>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
|
|
+ </template>
|
|
<div class="button-box">
|
|
<div class="button-box">
|
|
<el-button type="primary" @click="makeSure">确认新增</el-button>
|
|
<el-button type="primary" @click="makeSure">确认新增</el-button>
|
|
<el-button type="primary" @click="cancel">返回</el-button>
|
|
<el-button type="primary" @click="cancel">返回</el-button>
|
|
@@ -54,84 +74,86 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
restaurants: [],
|
|
restaurants: [],
|
|
- state2:null,
|
|
|
|
- planTruckNumber:null,
|
|
|
|
- carrierId:null,
|
|
|
|
- requirementId:null,
|
|
|
|
|
|
+ state2: null,
|
|
|
|
+ planTruckNumber: null,
|
|
|
|
+ carrierId: null,
|
|
|
|
+ requirementId: null,
|
|
form: {},
|
|
form: {},
|
|
- first:{
|
|
|
|
- requestUrl:"/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
|
|
|
|
|
|
+ first: {
|
|
|
|
+ requestUrl:
|
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
- columnIndexs:[0,1,2,3,4,20,21,22],
|
|
|
|
|
|
+ columnIndexs: [0, 1, 2, 3, 4, 20, 21, 22],
|
|
comparison: "requirementNumber",
|
|
comparison: "requirementNumber",
|
|
- mapList: {},
|
|
|
|
|
|
+ mapList: {}
|
|
},
|
|
},
|
|
numberValidateForm: {
|
|
numberValidateForm: {
|
|
- planTruckNumber: null,
|
|
|
|
- },
|
|
|
|
|
|
+ planTruckNumber: null
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- handleSelect(item){
|
|
|
|
- this.carrierId = item.carrierId
|
|
|
|
- this.state2 = item.carrierName
|
|
|
|
|
|
+ handleSelect(item) {
|
|
|
|
+ this.carrierId = item.carrierId;
|
|
|
|
+ this.state2 = item.carrierName;
|
|
},
|
|
},
|
|
- //搜索
|
|
|
|
|
|
+ //搜索
|
|
querySearch(queryString, cb) {
|
|
querySearch(queryString, cb) {
|
|
- this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+this.state2).then((res)=>{
|
|
|
|
- if(res.data.code == "200"){
|
|
|
|
- console.log(res)
|
|
|
|
- var restaurants = res.data.data
|
|
|
|
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) :restaurants;
|
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
|
- console.log(results,"results");
|
|
|
|
- cb(results);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- createFilter(queryString) {
|
|
|
|
- return (restaurants) => {
|
|
|
|
- return (restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- currentRadioChange(selection){
|
|
|
|
- this.mapList = selection
|
|
|
|
- this.requirementId = selection.requirementId
|
|
|
|
- console.log(this.mapList)
|
|
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/v1/uc/getCarrierMesByLike?index=" + this.state2)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.data.code == "200") {
|
|
|
|
+ console.log(res);
|
|
|
|
+ var restaurants = res.data.data;
|
|
|
|
+ var results = queryString
|
|
|
|
+ ? restaurants.filter(this.createFilter(queryString))
|
|
|
|
+ : restaurants;
|
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
|
+ console.log(results, "results");
|
|
|
|
+ cb(results);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ createFilter(queryString) {
|
|
|
|
+ return restaurants => {
|
|
|
|
+ return (
|
|
|
|
+ restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
|
|
|
|
+ -1
|
|
|
|
+ );
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ currentRadioChange(selection) {
|
|
|
|
+ this.mapList = selection;
|
|
|
|
+ this.requirementId = selection.requirementId;
|
|
|
|
+ console.log(this.mapList);
|
|
},
|
|
},
|
|
// 新增
|
|
// 新增
|
|
makeSure() {
|
|
makeSure() {
|
|
- console.log(typeof(this.planTruckNumber))
|
|
|
|
- if(this.carrierId == null){
|
|
|
|
- this.$alert('请输入承运商!')
|
|
|
|
- return
|
|
|
|
- }else if(this.requirementId== null){
|
|
|
|
- this.$alert('请选择需要制定计划的需求!')
|
|
|
|
- return
|
|
|
|
|
|
+ console.log(typeof this.planTruckNumber);
|
|
|
|
+ if (this.carrierId == null || this.state2 == "") {
|
|
|
|
+ this.$alert("请输入承运商!");
|
|
|
|
+ return;
|
|
|
|
+ } else if (this.requirementId == null) {
|
|
|
|
+ this.$alert("请选择需要制定计划的需求!");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
let plan = {
|
|
let plan = {
|
|
- requirementId : this.mapList.requirementId,
|
|
|
|
|
|
+ requirementId: this.mapList.requirementId,
|
|
planTruckNumber: Number(this.planTruckNumber),
|
|
planTruckNumber: Number(this.planTruckNumber),
|
|
carrierId: this.carrierId
|
|
carrierId: this.carrierId
|
|
};
|
|
};
|
|
- this.axios
|
|
|
|
- .post(
|
|
|
|
- "/api/v1/ams/addTruckPlan",
|
|
|
|
- plan
|
|
|
|
- )
|
|
|
|
- .then((res) => {
|
|
|
|
- console.log(res)
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "新增成功!",
|
|
|
|
- });
|
|
|
|
- this.$router.go(-1);
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("新增失败!");
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ this.axios.post("/api/v1/ams/addTruckPlan", plan).then(res => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "新增成功!"
|
|
|
|
+ });
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("新增失败!");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
cancel() {
|
|
cancel() {
|
|
@@ -142,24 +164,26 @@ export default {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
- center: true,
|
|
|
|
|
|
+ center: true
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.axios
|
|
this.axios
|
|
.post(
|
|
.post(
|
|
"/api/v1/ams/deleteTruckRequirement/" + scope.row.requirementId
|
|
"/api/v1/ams/deleteTruckRequirement/" + scope.row.requirementId
|
|
)
|
|
)
|
|
- .then((res) => {
|
|
|
|
|
|
+ .then(res => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
type: "success",
|
|
type: "success",
|
|
- message: "拒绝成功!",
|
|
|
|
|
|
+ message: "拒绝成功!"
|
|
});
|
|
});
|
|
- this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2&i=" + new Date()
|
|
|
|
|
|
+ this.first.requestUrl =
|
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2&i=" +
|
|
|
|
+ new Date();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: "拒绝失败",
|
|
message: "拒绝失败",
|
|
- type: "warning",
|
|
|
|
|
|
+ type: "warning"
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -167,41 +191,38 @@ export default {
|
|
.catch(() => {
|
|
.catch(() => {
|
|
this.$message({
|
|
this.$message({
|
|
type: "info",
|
|
type: "info",
|
|
- message: "删除操作已取消!",
|
|
|
|
|
|
+ message: "删除操作已取消!"
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.addInwardPlan{
|
|
|
|
-.carrier{
|
|
|
|
- display: inline-block !important;
|
|
|
|
- margin-left: 38%;
|
|
|
|
- .el-input{
|
|
|
|
- width:250px
|
|
|
|
- }
|
|
|
|
- .input{
|
|
|
|
- margin-left: -10px;
|
|
|
|
|
|
+.addInwardPlan {
|
|
|
|
+ .carrier {
|
|
|
|
+ display: inline-block !important;
|
|
|
|
+ margin-left: 38%;
|
|
|
|
+ .el-input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ }
|
|
|
|
+ .input {
|
|
|
|
+ margin-left: -10px;
|
|
|
|
+ }
|
|
|
|
+ .el-form {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- .el-form{
|
|
|
|
- padding: 10px;
|
|
|
|
|
|
+ .truckNum {
|
|
|
|
+ .el-input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-}
|
|
|
|
-.truckNum {
|
|
|
|
- .el-input{
|
|
|
|
- width: 250px;
|
|
|
|
|
|
+ .button-box {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ margin-left: 25px !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.button-box
|
|
|
|
-{
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: center;
|
|
|
|
- margin-left: 25px !important;
|
|
|
|
-}
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
</style>
|
|
</style>
|