|
@@ -28,23 +28,22 @@
|
|
<script>
|
|
<script>
|
|
import PageTitle from "@/components/Page/Title";
|
|
import PageTitle from "@/components/Page/Title";
|
|
import { getCookie } from "@/utils/util.js";
|
|
import { getCookie } from "@/utils/util.js";
|
|
-let _this ;
|
|
|
|
export default {
|
|
export default {
|
|
components: { PageTitle },
|
|
components: { PageTitle },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
form1: {},
|
|
form1: {},
|
|
- // value: undefined,
|
|
|
|
|
|
+ value: undefined,
|
|
carrierIds: "",
|
|
carrierIds: "",
|
|
state: "",
|
|
state: "",
|
|
|
|
+ userId:null,
|
|
restaurants: [],
|
|
restaurants: [],
|
|
accessToken:null,
|
|
accessToken:null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- _this = this;
|
|
|
|
- _this.accessToken = getCookie("accessToken");
|
|
|
|
- console.log(this.accessToken ,'cookie1')
|
|
|
|
|
|
+ this.accessToken = getCookie("accessToken");
|
|
|
|
+ console.log(this.accessToken ,'cookie1')
|
|
},
|
|
},
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
@@ -64,60 +63,6 @@ export default {
|
|
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- 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 ,'cookie1')
|
|
|
|
-
|
|
|
|
-// let RmsCapacity={
|
|
|
|
-// capacityTypeId:this.form1.capacityTypeId,
|
|
|
|
-// capacityNumber:this.form1.capacityNumber.toUpperCase(),
|
|
|
|
-// number:this.capacityNumber,
|
|
|
|
-// 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,
|
|
|
|
-// };
|
|
|
|
-// console.log("RmsCapacity",RmsCapacity)
|
|
|
|
-// 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/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) {
|
|
querySearch(queryString, cb) {
|
|
var restaurants = this.restaurants;
|
|
var restaurants = this.restaurants;
|
|
var results = queryString
|
|
var results = queryString
|
|
@@ -138,10 +83,13 @@ export default {
|
|
this.carrierIds = item.carrierIds;
|
|
this.carrierIds = item.carrierIds;
|
|
console.log(item);
|
|
console.log(item);
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ deleteUser(userId){
|
|
|
|
+ this.axios.delete("pass/v1/sysusers/" + userId) .then((res) => {
|
|
|
|
+ this.$message.error("添加失败,车牌可能重复");
|
|
|
|
+ });
|
|
|
|
+ },
|
|
makeSure() {
|
|
makeSure() {
|
|
- console.log(this.from1);
|
|
|
|
- let RmsCapacity = {
|
|
|
|
|
|
+ let RmsCapacity = {
|
|
capacityTypeId: this.form1.capacityTypeId,
|
|
capacityTypeId: this.form1.capacityTypeId,
|
|
capacityNumber: this.form1.capacityNumber.toUpperCase(),
|
|
capacityNumber: this.form1.capacityNumber.toUpperCase(),
|
|
capacityCorlor: this.form1.capacityCorlor,
|
|
capacityCorlor: this.form1.capacityCorlor,
|
|
@@ -162,23 +110,57 @@ export default {
|
|
RmsCapacity.carrierIds == null
|
|
RmsCapacity.carrierIds == null
|
|
)
|
|
)
|
|
this.$message.error("存在空值!");
|
|
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();
|
|
|
|
- });
|
|
|
|
|
|
+ var formData = new FormData();
|
|
|
|
+ formData.append("userName",this.form1.capacityNumber.toUpperCase())
|
|
|
|
+ console.log(formData.get("userName"))
|
|
|
|
+ console.log(formData.set("userName",this.form1.capacityNumber.toUpperCase()))
|
|
|
|
+ console.log(formData)
|
|
|
|
+ formData.append('userCode',this.form1.capacityNumber.toUpperCase())
|
|
|
|
+ formData.append('orgCode','yunli')
|
|
|
|
+ formData.append('orgName','运力')
|
|
|
|
+ formData.append('groupId','506514577756917769')
|
|
|
|
+ formData.append('companyId','713710108567277568')
|
|
|
|
+ formData.append('orgId','924126716337721344')
|
|
|
|
+ console.log(formData.get("userCode"))
|
|
|
|
+ console.log(typeof formData)
|
|
|
|
+ this.$store.dispatch("system/usersManage/addUser", formData).then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === "0") {
|
|
|
|
+ console.log(res.data.userId)
|
|
|
|
+ this.userId = res.data.userId
|
|
|
|
+ RmsCapacity.ssoId = res.data.userId
|
|
|
|
+ console.log(RmsCapacity)
|
|
|
|
+ this.axios.post("/api/v1/rms/insertCapacity",RmsCapacity).then((res) => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if(res.data.code == '200'){
|
|
|
|
+ this.$message.success("添加成功");
|
|
|
|
+ }
|
|
|
|
+ else if(res.data.code == '201'){
|
|
|
|
+ this.deleteUser(this.userId)
|
|
|
|
+ }else{
|
|
|
|
+ this.deleteUser(this.userId)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // 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() {
|
|
cancel() {
|