|
@@ -2,13 +2,14 @@
|
|
|
<!-- 添加运力信息 -->
|
|
|
<div class="addWagonLoad">
|
|
|
<PageTitle>返回</PageTitle>
|
|
|
- <el-divider content-position="left">运力信息</el-divider>
|
|
|
- <div class="form-box" style="margin-right: 10rem">
|
|
|
- <dil-form :formId="309" v-model="form1" ref="from1"></dil-form>
|
|
|
- </div>
|
|
|
- <div class="inputBox">
|
|
|
- <span class="text">所属单位类型</span>
|
|
|
+ <!-- <el-divider content-position="left">运力信息</el-divider> -->
|
|
|
+ <div class="form_box" style="margin-right: 160px">
|
|
|
+ <dil-form :formId="309" v-model="form1" ref="from1"></dil-form>
|
|
|
+ </div>
|
|
|
+ <div class="inputBox">
|
|
|
+ <span class="text">所属单位类型</span>
|
|
|
<el-autocomplete
|
|
|
+ class="input"
|
|
|
v-model="state"
|
|
|
@input="onInput"
|
|
|
:fetch-suggestions="querySearch"
|
|
@@ -16,8 +17,8 @@
|
|
|
:trigger-on-focus="false"
|
|
|
@select="handleSelect"
|
|
|
></el-autocomplete>
|
|
|
- </div>
|
|
|
- <div class="button-box">
|
|
|
+ </div>
|
|
|
+ <div class="button_box">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
<el-button type="primary" @click="makeSure">确定</el-button>
|
|
|
</div>
|
|
@@ -33,87 +34,89 @@ export default {
|
|
|
return {
|
|
|
form1: {},
|
|
|
// value: undefined,
|
|
|
- carrierIds:"",
|
|
|
+ carrierIds: "",
|
|
|
state: "",
|
|
|
restaurants: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
- onInput() {
|
|
|
- this.axios.post(
|
|
|
- "/api/v1/rms/getCarrierName?state="+this.state,
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- if(res.data.code == "200"){
|
|
|
- res.data.data.forEach(element => {
|
|
|
- this.restaurants.push({
|
|
|
- value:element.carrierName,
|
|
|
- carrierIds:element.carrierId
|
|
|
- })
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- },
|
|
|
- querySearch(queryString, cb) {
|
|
|
- var restaurants = this.restaurants;
|
|
|
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
- },
|
|
|
- createFilter(queryString) {
|
|
|
- return (restaurant) => {
|
|
|
- return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
|
|
- };
|
|
|
- },
|
|
|
- handleSelect(item){
|
|
|
- this.carrierIds=item.carrierIds;
|
|
|
- console.log(item)
|
|
|
- },
|
|
|
-
|
|
|
- makeSure() {
|
|
|
- console.log(this.from1)
|
|
|
- let RmsCapacity={
|
|
|
- capacityTypeId:this.form1.capacityTypeId,
|
|
|
- capacityNumber:this.form1.capacityNumber.toUpperCase(),
|
|
|
- capacityCorlor:this.form1.capacityCorlor,
|
|
|
- capacityOwneris:this.form1.capacityOwneris,
|
|
|
- capacityVip:this.form1.capacityVip,
|
|
|
- capacityBlacklist:this.form1.capacityBlacklist,
|
|
|
- // carrierId:this.form1.carrierId,
|
|
|
- state:this.state,
|
|
|
- carrierName:this.state,
|
|
|
- carrierIds: this.carrierIds,
|
|
|
- };
|
|
|
- if(
|
|
|
- RmsCapacity.capacityNumber==null ||
|
|
|
- RmsCapacity.capacityCorlor==null ||
|
|
|
- RmsCapacity.capacityOwneris==null ||
|
|
|
- RmsCapacity.capacityVip==null ||
|
|
|
- RmsCapacity.capacityBlacklist==null ||
|
|
|
- RmsCapacity.carrierIds==null
|
|
|
- )this.$message.error("存在空值!");
|
|
|
- else
|
|
|
+ onInput() {
|
|
|
this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/rms/insertCapacity", RmsCapacity
|
|
|
- )
|
|
|
+ .post("/api/v1/rms/getCarrierName?state=" + this.state)
|
|
|
.then((res) => {
|
|
|
- console.log("res.data.code",res.data.code);
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "新增成功!",
|
|
|
+ if (res.data.code == "200") {
|
|
|
+ res.data.data.forEach((element) => {
|
|
|
+ this.restaurants.push({
|
|
|
+ value: element.carrierName,
|
|
|
+ carrierIds: element.carrierId,
|
|
|
+ });
|
|
|
});
|
|
|
- // this.$refs.table.refreshData();
|
|
|
- this.$router.go(-1);
|
|
|
- } else {
|
|
|
- this.$message.error("新增失败,可能存在重复!");
|
|
|
}
|
|
|
- // this.$refs['table'].resetField();
|
|
|
});
|
|
|
},
|
|
|
+ querySearch(queryString, cb) {
|
|
|
+ var restaurants = this.restaurants;
|
|
|
+ var results = queryString
|
|
|
+ ? restaurants.filter(this.createFilter(queryString))
|
|
|
+ : restaurants;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ cb(results);
|
|
|
+ },
|
|
|
+ createFilter(queryString) {
|
|
|
+ return (restaurant) => {
|
|
|
+ return (
|
|
|
+ restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleSelect(item) {
|
|
|
+ this.carrierIds = item.carrierIds;
|
|
|
+ console.log(item);
|
|
|
+ },
|
|
|
+
|
|
|
+ makeSure() {
|
|
|
+ console.log(this.from1);
|
|
|
+ let RmsCapacity = {
|
|
|
+ capacityTypeId: this.form1.capacityTypeId,
|
|
|
+ capacityNumber: this.form1.capacityNumber.toUpperCase(),
|
|
|
+ capacityCorlor: this.form1.capacityCorlor,
|
|
|
+ capacityOwneris: this.form1.capacityOwneris,
|
|
|
+ capacityVip: this.form1.capacityVip,
|
|
|
+ capacityBlacklist: this.form1.capacityBlacklist,
|
|
|
+ // carrierId:this.form1.carrierId,
|
|
|
+ state: this.state,
|
|
|
+ carrierName: this.state,
|
|
|
+ carrierIds: this.carrierIds,
|
|
|
+ };
|
|
|
+ if (
|
|
|
+ RmsCapacity.capacityNumber == null ||
|
|
|
+ RmsCapacity.capacityCorlor == null ||
|
|
|
+ RmsCapacity.capacityOwneris == null ||
|
|
|
+ RmsCapacity.capacityVip == null ||
|
|
|
+ RmsCapacity.capacityBlacklist == null ||
|
|
|
+ RmsCapacity.carrierIds == null
|
|
|
+ )
|
|
|
+ this.$message.error("存在空值!");
|
|
|
+ else
|
|
|
+ this.axios
|
|
|
+ .post("/api/v1/rms/insertCapacity", RmsCapacity)
|
|
|
+ .then((res) => {
|
|
|
+ console.log("res.data.code", res.data.code);
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "新增成功!",
|
|
|
+ });
|
|
|
+ // this.$refs.table.refreshData();
|
|
|
+ this.$router.go(-1);
|
|
|
+ } else {
|
|
|
+ this.$message.error("新增失败,可能存在重复!");
|
|
|
+ }
|
|
|
+ // this.$refs['table'].resetField();
|
|
|
+ });
|
|
|
+ },
|
|
|
// 取消
|
|
|
cancel() {
|
|
|
this.$router.go(-1);
|
|
@@ -122,39 +125,49 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang='scss' >
|
|
|
-.button-box{
|
|
|
- display: flex;
|
|
|
- text-align: center;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 0.3125rem;
|
|
|
- margin-bottom: 1.25rem;
|
|
|
-}
|
|
|
-.inputBox{
|
|
|
- display: flex;
|
|
|
- text-align: center;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 0.1000rem;
|
|
|
- margin-bottom: 0.25rem;
|
|
|
- margin-left: -12rem;
|
|
|
-}
|
|
|
-.form-box{
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- .el-form-item{
|
|
|
+.addWagonLoad {
|
|
|
+ .form_box {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 30px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .el-form-item{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .el-form-item__label{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .el-form-item__content{
|
|
|
+ .el-select{
|
|
|
+ width: 250px;
|
|
|
+ }
|
|
|
+ .el-input{
|
|
|
+ width: 250px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .inputBox{
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
- .el-form-item__label{
|
|
|
+ margin-bottom: 30px;
|
|
|
+ .text{
|
|
|
+ text-align: right;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ margin-right: 5px;
|
|
|
}
|
|
|
- .el-form-item__content{
|
|
|
- .el-input{
|
|
|
- .el-input__inner{
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- }
|
|
|
+ .input{
|
|
|
+ width: 250px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .button_box{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .el-button{
|
|
|
+ width: 80px;
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
}
|
|
|
}
|