|
@@ -63,23 +63,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import PageTitle from "@/components/Page/Title";
|
|
|
-import { getCookie } from "@/utils/util.js";
|
|
|
+import PageTitle from '@/components/Page/Title'
|
|
|
+import { getCookie } from '@/utils/util.js'
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- driverLicence: "",
|
|
|
+ driverLicence: '',
|
|
|
addLoading: false,
|
|
|
form1: {},
|
|
|
- shippingCertificate: "",
|
|
|
+ shippingCertificate: '',
|
|
|
form1Initialization: {
|
|
|
capacityTypeId: 1,
|
|
|
- capacityNumber: "",
|
|
|
- capacityCorlor: "黄",
|
|
|
- capacityOwneris: "否",
|
|
|
- capacityVip: "否",
|
|
|
- capacityBlacklist: "否"
|
|
|
+ capacityNumber: '',
|
|
|
+ capacityCorlor: '黄',
|
|
|
+ capacityOwneris: '否',
|
|
|
+ capacityVip: '否',
|
|
|
+ capacityBlacklist: '否'
|
|
|
},
|
|
|
value: undefined,
|
|
|
carrierIds: null,
|
|
@@ -90,162 +90,162 @@ export default {
|
|
|
userCode: null,
|
|
|
carrierUserId: null,
|
|
|
carrierId: null,
|
|
|
- orgcode:null
|
|
|
- };
|
|
|
+ orgcode: null
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.carrierUserId = getCookie("userId");
|
|
|
- this.orgcode = getCookie("orgCode");
|
|
|
- if(this.orgcode === "wuliuyunshubu" || this.orgcode === "dagangadmin"){
|
|
|
-
|
|
|
+ this.carrierUserId = getCookie('userId')
|
|
|
+ this.orgcode = getCookie('orgCode')
|
|
|
+ if (this.orgcode === 'wuliuyunshubu' || this.orgcode === 'dagangadmin') {
|
|
|
}
|
|
|
- this.form1 = this.form1Initialization;
|
|
|
+ this.form1 = this.form1Initialization
|
|
|
},
|
|
|
mounted() {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=" + this.carrierUserId
|
|
|
+ '/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=' + this.carrierUserId
|
|
|
)
|
|
|
.then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
+ if (res.data.code == '200') {
|
|
|
// console.log(res.data.data);
|
|
|
if (res.data.data) {
|
|
|
- this.state = res.data.data.carrierName;
|
|
|
- this.carrierIds = res.data.data.carrierId;
|
|
|
+ this.state = res.data.data.carrierName
|
|
|
+ this.carrierIds = res.data.data.carrierId
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
upCLick(val) {
|
|
|
- this.num = val;
|
|
|
+ this.num = val
|
|
|
},
|
|
|
beforeUpload(file) {
|
|
|
- this.upBool = true;
|
|
|
- const isLt2M = file.size < 1024 * 1024 * 0.5;
|
|
|
+ this.upBool = true
|
|
|
+ const isLt2M = file.size < 1024 * 1024 * 0.5
|
|
|
if (!isLt2M) {
|
|
|
- this.$message.error("上传文件大小不能超过500kb!");
|
|
|
+ this.$message.error('上传文件大小不能超过500kb!')
|
|
|
} else {
|
|
|
- let size = file.size / 1024;
|
|
|
- let _URL = window.URL || window.webkitURL;
|
|
|
- let img = new Image();
|
|
|
- img.src = _URL.createObjectURL(file);
|
|
|
+ let size = file.size / 1024
|
|
|
+ let _URL = window.URL || window.webkitURL
|
|
|
+ let img = new Image()
|
|
|
+ img.src = _URL.createObjectURL(file)
|
|
|
}
|
|
|
- return isLt2M;
|
|
|
+ return isLt2M
|
|
|
},
|
|
|
onError(err) {
|
|
|
if (this.upBool) {
|
|
|
if (this.num == 1) {
|
|
|
- this.shippingCertificate = null;
|
|
|
- this.imageUrl1 = null;
|
|
|
+ this.shippingCertificate = null
|
|
|
+ this.imageUrl1 = null
|
|
|
// this.$message.error("上传失败");
|
|
|
} else if (this.num == 2) {
|
|
|
- this.businessLicense = null;
|
|
|
- this.imageUrl2 = null;
|
|
|
+ this.businessLicense = null
|
|
|
+ this.imageUrl2 = null
|
|
|
// this.$message.error("上传失败");
|
|
|
} else if (this.num == 3) {
|
|
|
- this.businessLicense1 = null;
|
|
|
- this.imageUrl3 = null;
|
|
|
+ this.businessLicense1 = null
|
|
|
+ this.imageUrl3 = null
|
|
|
// this.$message.error("上传失败");
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
handleAvatarSuccess(res, file) {
|
|
|
- console.log(res, file);
|
|
|
+ console.log(res, file)
|
|
|
if (res.code) {
|
|
|
- this.upBool = false;
|
|
|
+ this.upBool = false
|
|
|
if (this.num == 1) {
|
|
|
- this.driverLicence = res.data;
|
|
|
- this.shippingCertificate = file.name;
|
|
|
+ this.driverLicence = res.data
|
|
|
+ this.shippingCertificate = file.name
|
|
|
} else if (this.num == 2) {
|
|
|
- this.imageUrl2 = res.data;
|
|
|
- this.businessLicense = file.name;
|
|
|
+ this.imageUrl2 = res.data
|
|
|
+ this.businessLicense = file.name
|
|
|
} else if (this.num == 3) {
|
|
|
- this.imageUrl3 = res.data;
|
|
|
- this.businessLicense1 = file.name;
|
|
|
+ this.imageUrl3 = res.data
|
|
|
+ this.businessLicense1 = file.name
|
|
|
}
|
|
|
- this.$message.success("上传成功");
|
|
|
+ this.$message.success('上传成功')
|
|
|
}
|
|
|
},
|
|
|
//承运商弹出层
|
|
|
handleSelect(item) {
|
|
|
- this.carrierIds = item.carrierId;
|
|
|
- item.carrierName = this.state;
|
|
|
+ this.carrierIds = item.carrierId
|
|
|
+ item.carrierName = this.state
|
|
|
},
|
|
|
//以下是承运商边输边查搜索
|
|
|
querySearch(queryString, cb) {
|
|
|
this.axios
|
|
|
- .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
|
|
|
+ .post('/api/v1/uc/getCarrierMesByLike?index=' + queryString)
|
|
|
.then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
+ if (res.data.code == '200') {
|
|
|
// console.log(res.data.data);
|
|
|
- var restaurants = res.data.data;
|
|
|
+ var restaurants = res.data.data
|
|
|
// console.log(restaurants, "restaurants");
|
|
|
var results = queryString
|
|
|
? restaurants.filter(this.createFilter(queryString))
|
|
|
- : restaurants;
|
|
|
+ : restaurants
|
|
|
// 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
+ cb(results)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
createFilter(queryString) {
|
|
|
return restaurants => {
|
|
|
return (
|
|
|
restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
|
|
|
-1
|
|
|
- );
|
|
|
- };
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//以上是承运商边输边查搜索
|
|
|
deleteUser(userId) {
|
|
|
- this.axios.delete("pass/v1/sysusers/" + userId).then(res => {
|
|
|
- this.$message.error("添加失败,车牌可能重复");
|
|
|
- });
|
|
|
+ this.axios.delete('pass/v1/sysusers/' + userId).then(res => {
|
|
|
+ this.$message.error('添加失败,车牌可能重复')
|
|
|
+ })
|
|
|
},
|
|
|
insertRole(userId, userCode) {
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "pass/v1/sysuserroles/addUserroles?userId=" +
|
|
|
+ 'pass/v1/sysuserroles/addUserroles?userId=' +
|
|
|
userId +
|
|
|
- "&userCode=" +
|
|
|
+ '&userCode=' +
|
|
|
userCode +
|
|
|
- "&roleId=" +
|
|
|
- "923693668269953024"
|
|
|
+ '&roleId=' +
|
|
|
+ '923693668269953024'
|
|
|
)
|
|
|
.then(res => {
|
|
|
- if (res.code === "0") {
|
|
|
- this.$message.success("操作成功");
|
|
|
- this.saveLoading = false;
|
|
|
- this.rolesTree.loading = false;
|
|
|
+ if (res.code === '0') {
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.$router.push('capacity')
|
|
|
+ // this.saveLoading = false;
|
|
|
+ // this.rolesTree.loading = false;
|
|
|
} else {
|
|
|
- this.$message.error(res.message);
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
isVehicleNumber(vehicleNumber) {
|
|
|
// console.log(vehicleNumber);
|
|
|
- var result = false;
|
|
|
+ var result = false
|
|
|
if (vehicleNumber.length == 7) {
|
|
|
- var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使场领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
|
|
|
- result = express.test(vehicleNumber);
|
|
|
- }else if(vehicleNumber.length == 8){
|
|
|
- var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}[A-HJ-NP-Z]{1}(([A-HJ-NP-Z0-9]{5})|([0-9]{6}|[A-HJ-NP-Z]{1}[0-9]{5}|[0-9]{5}[A-HJ-NP-Z]{1}|[A-HJ-NP-Z]{2}[0-9]{4}))$/;
|
|
|
- result = express.test(vehicleNumber);
|
|
|
+ var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使场领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
|
|
|
+ result = express.test(vehicleNumber)
|
|
|
+ } else if (vehicleNumber.length == 8) {
|
|
|
+ var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}[A-HJ-NP-Z]{1}(([A-HJ-NP-Z0-9]{5})|([0-9]{6}|[A-HJ-NP-Z]{1}[0-9]{5}|[0-9]{5}[A-HJ-NP-Z]{1}|[A-HJ-NP-Z]{2}[0-9]{4}))$/
|
|
|
+ result = express.test(vehicleNumber)
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result
|
|
|
},
|
|
|
makeSure() {
|
|
|
- this.addLoading = true;
|
|
|
+ this.addLoading = true
|
|
|
if (!this.isVehicleNumber(this.form1.capacityNumber.toUpperCase())) {
|
|
|
- this.$message.error("车牌号格式不正确");
|
|
|
- this.addLoading = false;
|
|
|
- return;
|
|
|
+ this.$message.error('车牌号格式不正确')
|
|
|
+ this.addLoading = false
|
|
|
+ return
|
|
|
}
|
|
|
if (this.carrierIds == null) {
|
|
|
- this.$message.error("请选择承运商");
|
|
|
- this.addLoading = false;
|
|
|
- return;
|
|
|
+ this.$message.error('请选择承运商')
|
|
|
+ this.addLoading = false
|
|
|
+ return
|
|
|
}
|
|
|
let RmsCapacity = {
|
|
|
capacityTypeId: this.form1.capacityTypeId,
|
|
@@ -258,9 +258,9 @@ export default {
|
|
|
remark: this.form1.remark,
|
|
|
carrierId: this.carrierIds,
|
|
|
state: this.state,
|
|
|
- capacityTel:this.form1.capacityTel
|
|
|
- };
|
|
|
- console.log(RmsCapacity);
|
|
|
+ capacityTel: this.form1.capacityTel
|
|
|
+ }
|
|
|
+ console.log(RmsCapacity)
|
|
|
if (
|
|
|
RmsCapacity.capacityNumber == null ||
|
|
|
RmsCapacity.capacityCorlor == null ||
|
|
@@ -268,85 +268,83 @@ export default {
|
|
|
RmsCapacity.capacityVip == null ||
|
|
|
RmsCapacity.capacityBlacklist == null
|
|
|
) {
|
|
|
- this.$message.error("存在空值!");
|
|
|
- this.addLoading = false;
|
|
|
+ this.$message.error('存在空值!')
|
|
|
+ this.addLoading = false
|
|
|
} else {
|
|
|
//新增SSO运力账号
|
|
|
- var formData = new FormData();
|
|
|
- formData.append("userCode", this.form1.capacityNumber.toUpperCase());
|
|
|
- formData.append("orgCode", "yunli");
|
|
|
- formData.append("orgName", "运力");
|
|
|
+ var formData = new 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");
|
|
|
+ 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)
|
|
|
+ .dispatch('system/usersManage/addUser', formData)
|
|
|
.then(res => {
|
|
|
// console.log(res);
|
|
|
- if (res.code === "0") {
|
|
|
+ if (res.code === '0') {
|
|
|
// console.log(res.data.userId);
|
|
|
- this.userId = res.data.userId;
|
|
|
- this.userCode = res.data.userCode;
|
|
|
- RmsCapacity.ssoId = res.data.userId;
|
|
|
+ this.userId = res.data.userId
|
|
|
+ this.userCode = res.data.userCode
|
|
|
+ RmsCapacity.ssoId = res.data.userId
|
|
|
this.axios
|
|
|
- .post("/api/v1/rms/insertCapacity", RmsCapacity)
|
|
|
+ .post('/api/v1/rms/insertCapacity', RmsCapacity)
|
|
|
.then(res => {
|
|
|
if (res.data.data == 1) {
|
|
|
- this.insertRole(this.userId, this.userCode);
|
|
|
- this.$message.success("添加成功");
|
|
|
- this.$router.push("capacity");
|
|
|
- } else if (res.data.code == "201") {
|
|
|
- this.deleteUser(this.userId);
|
|
|
+ this.insertRole(this.userId, this.userCode)
|
|
|
+ } else if (res.data.code == '201') {
|
|
|
+ this.deleteUser(this.userId)
|
|
|
} else {
|
|
|
- this.deleteUser(this.userId);
|
|
|
+ this.deleteUser(this.userId)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
// console.log(RmsCapacity, "RmsCapacity");
|
|
|
- if (res.message == "账号已被注册") {
|
|
|
+ if (res.message == '账号已被注册') {
|
|
|
this.$confirm(
|
|
|
- "该账号已经被注册, 是否确定新增承运商绑定关系?",
|
|
|
- "提示",
|
|
|
+ '该账号已经被注册, 是否确定新增承运商绑定关系?',
|
|
|
+ '提示',
|
|
|
{
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
this.axios
|
|
|
- .post("/api/v1/rms/insertCapacity", RmsCapacity)
|
|
|
+ .post('/api/v1/rms/insertCapacity', RmsCapacity)
|
|
|
.then(res => {
|
|
|
// console.log(res, "res");
|
|
|
if (res.data.data == 0) {
|
|
|
- this.$message.success("新增承运商绑定关系成功!");
|
|
|
- this.$router.push("capacity");
|
|
|
+ this.$message.success('新增承运商绑定关系成功!')
|
|
|
+ this.$router.push('capacity')
|
|
|
} else {
|
|
|
- this.$message.error("该绑定关系已存在!");
|
|
|
+ this.$message.error('该绑定关系已存在!')
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除"
|
|
|
- });
|
|
|
- });
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- this.addLoading = false;
|
|
|
+ })
|
|
|
+ this.addLoading = false
|
|
|
}
|
|
|
},
|
|
|
// 取消
|
|
|
cancel() {
|
|
|
- this.$router.go(-1);
|
|
|
+ this.$router.go(-1)
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.shippingCertificate {
|