|
@@ -6,7 +6,7 @@
|
|
<div class="form_box" style="margin-right: 10rem">
|
|
<div class="form_box" style="margin-right: 10rem">
|
|
<dil-form :formId="309" v-model="form1" ref="from1"></dil-form>
|
|
<dil-form :formId="309" v-model="form1" ref="from1"></dil-form>
|
|
</div>
|
|
</div>
|
|
- <div class="inputBox">
|
|
|
|
|
|
+ <!-- <div class="inputBox">
|
|
<span class="text">所属承运商</span>
|
|
<span class="text">所属承运商</span>
|
|
<el-autocomplete
|
|
<el-autocomplete
|
|
class="input"
|
|
class="input"
|
|
@@ -17,7 +17,7 @@
|
|
:trigger-on-focus="false"
|
|
:trigger-on-focus="false"
|
|
@select="handleSelect"
|
|
@select="handleSelect"
|
|
></el-autocomplete>
|
|
></el-autocomplete>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
<div class="button_box">
|
|
<div class="button_box">
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button type="primary" @click="makeSure">确定</el-button>
|
|
<el-button type="primary" @click="makeSure">确定</el-button>
|
|
@@ -28,120 +28,91 @@
|
|
<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,
|
|
|
|
+ userCode:null,
|
|
|
|
+ carrierUserId:null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- _this = this;
|
|
|
|
- _this.accessToken = getCookie("accessToken");
|
|
|
|
- console.log(this.accessToken ,'cookie1')
|
|
|
|
|
|
+ this.carrierUserId = getCookie("userId");
|
|
|
|
+ console.log(this.carrierUserId ,'carrierUserId')
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
methods: {
|
|
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
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // 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 ,'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) {
|
|
|
|
+ // 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);
|
|
|
|
+ // },
|
|
|
|
+ deleteUser(userId){
|
|
|
|
+ this.axios.delete("pass/v1/sysusers/" + userId) .then((res) => {
|
|
|
|
+ this.$message.error("添加失败,车牌可能重复");
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- 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);
|
|
|
|
|
|
+ insertRole(userId,userCode){
|
|
|
|
+ this.axios
|
|
|
|
+ .post(
|
|
|
|
+ "pass/v1/sysuserroles/addUserroles?userId=" +
|
|
|
|
+ userId +
|
|
|
|
+ "&userCode=" +
|
|
|
|
+ userCode +
|
|
|
|
+ "&roleId=" +
|
|
|
|
+ '923693668269953024'
|
|
|
|
+ ).then((res) => {
|
|
|
|
+ if (res.code === "0") {
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
+ this.saveLoading = false;
|
|
|
|
+ this.rolesTree.loading = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
-
|
|
|
|
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,
|
|
@@ -150,35 +121,70 @@ export default {
|
|
capacityBlacklist: this.form1.capacityBlacklist,
|
|
capacityBlacklist: this.form1.capacityBlacklist,
|
|
// carrierId:this.form1.carrierId,
|
|
// carrierId:this.form1.carrierId,
|
|
state: this.state,
|
|
state: this.state,
|
|
- carrierName: this.state,
|
|
|
|
- carrierIds: this.carrierIds,
|
|
|
|
|
|
+ carrierUserId:this.carrierUserId
|
|
};
|
|
};
|
|
if (
|
|
if (
|
|
RmsCapacity.capacityNumber == null ||
|
|
RmsCapacity.capacityNumber == null ||
|
|
RmsCapacity.capacityCorlor == null ||
|
|
RmsCapacity.capacityCorlor == null ||
|
|
RmsCapacity.capacityOwneris == null ||
|
|
RmsCapacity.capacityOwneris == null ||
|
|
RmsCapacity.capacityVip == null ||
|
|
RmsCapacity.capacityVip == null ||
|
|
- RmsCapacity.capacityBlacklist == null ||
|
|
|
|
- RmsCapacity.carrierIds == null
|
|
|
|
|
|
+ RmsCapacity.capacityBlacklist == 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
|
|
|
|
+ this.userCode = res.data.userCode
|
|
|
|
+ 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.insertRole(this.userId,this.userCode)
|
|
|
|
+ this.$message.success("添加成功");
|
|
|
|
+ this.$router.push('capacity')
|
|
|
|
+ }
|
|
|
|
+ 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() {
|