Commit e457f6d5 by 张杰

Merge branch 'v1.26.0' into 'develop'

V1.26.0

See merge request !64
2 parents 9a319049 af74b908
...@@ -183,3 +183,8 @@ export const REST_FREQ_INFO = params => { ...@@ -183,3 +183,8 @@ export const REST_FREQ_INFO = params => {
export const REPUSH_WORK_ORDER = params => { export const REPUSH_WORK_ORDER = params => {
return api.get('workOrder/retweetWorkOrder', params) return api.get('workOrder/retweetWorkOrder', params)
} }
// 业务管理-车辆管理-三码合一照片修改
export const UPDATE_THREECODE_IMAGE = params => {
return api.post('vehicle/updateThreeCodeImage', params, 'object')
}
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="image_upload_page"> <div class="image_upload_page">
<!-- 图片列表 开始 --> <!-- 图片列表 开始 -->
<div v-for="(item,index) in imgList" :key="index" class="img_cell"> <div
v-for="(item, index) in imgList"
:key="index"
class="img_cell"
:class="getCellClass(item)"
>
<div class="el_img_box"> <div class="el_img_box">
<i v-if="item.url" class="el-icon-error el_icon" @click="removeImage(item, index)" /> <i
<el-image v-if="item.url" class="el_img" lazy placeholder="加载中" :src="item.url" :preview-src-list="getPreViewList(item.url,imgList)" /> v-if="item.url"
<el-upload v-if="!item.url" v-loading="item.imageFlag" class="el_upload" :action="uploadUrl" list-type="picture-card" :accept="acceptFile" :show-file-list="false" :on-change="onChange" :http-request="(event)=>{uploadRequest(event, index)}"> class="el-icon-error el_icon"
@click="removeImage(item, index)"
/>
<el-image
v-if="item.url"
class="el_img"
lazy
placeholder="加载中"
:src="item.url"
:preview-src-list="getPreViewList(item.url, imgList)"
/>
<el-upload
v-if="!item.url"
v-loading="item.imageFlag"
class="el_upload"
:action="uploadUrl"
list-type="picture-card"
:accept="acceptFile"
:show-file-list="false"
:on-change="onChange"
:http-request="
(event) => {
uploadRequest(event, index);
}
"
>
<i class="el-icon-plus" /> <i class="el-icon-plus" />
</el-upload> </el-upload>
</div> </div>
<div class="img_name">{{ item.imageName }}</div> <div class="img_name">{{ item.imageName }}</div>
</div> </div>
<!-- 图片列表 end --> <!-- 图片列表 end -->
</div> </div>
</template> </template>
<script> <script>
import axios from 'axios' import axios from "axios";
import sign from '@/utils/sign' import sign from "@/utils/sign";
import qs from 'qs' import qs from "qs";
import { showToast } from '@/utils/util' import { showToast } from "@/utils/util";
export default { export default {
name: 'ImageUpload', name: "ImageUpload",
props: { props: {
value: { value: {
type: Array, type: Array,
default: function() { default: function () {
return [] return [];
} },
}, },
limit: { limit: {
type: [String, Number], type: [String, Number],
default: 20 default: 20,
} },
flag: {
type: [String, Number],
default: 0,
},
}, },
data() { data() {
return { return {
imgList: [], imgList: [],
uploadUrl: '', uploadUrl: "",
readStatus: '', readStatus: "",
acceptFile: '.jpg,.png' acceptFile: ".jpg,.png",
} imgFlag: 0, // 是否只让修改三码合一 1:只能修改三码合一
};
}, },
watch: { watch: {
value: { value: {
handler: function(n, o) { handler: function (n, o) {
this.imgList = n this.imgList = n;
}, },
immediate: true immediate: true,
}
}, },
mounted() { flag: {
handler: function (n) {
this.imgFlag = n;
}, },
immediate: true,
},
},
mounted() {},
methods: { methods: {
// 监听选择图片 // 监听选择图片
onChange(file, fileList) { onChange(file, fileList) {
console.log(file) console.log(file);
}, },
// 图片转换成base64 // 图片转换成base64
toBase64(file, index) { toBase64(file, index) {
const _this = this const _this = this;
const reader = new FileReader() const reader = new FileReader();
reader.readAsDataURL(file) reader.readAsDataURL(file);
reader.onload = (event) => { reader.onload = (event) => {
const imgFile = event.target.result const imgFile = event.target.result;
const arrBase64 = imgFile.split(',') const arrBase64 = imgFile.split(",");
const arr = file.name.split('.') const arr = file.name.split(".");
const _type = arr[arr.length - 1] const _type = arr[arr.length - 1];
const fileInfo = _type + '@' + arrBase64[1] const fileInfo = _type + "@" + arrBase64[1];
const oParams = { const oParams = {
fileName: file.name, fileName: file.name,
file: fileInfo file: fileInfo,
} };
_this.uploadImage(oParams, index) _this.uploadImage(oParams, index);
} };
}, },
// 自定义上传 // 自定义上传
uploadRequest(e, index) { uploadRequest(e, index) {
const file = e.file const file = e.file;
if (file.size > 10 * 1024 * 1024) { if (file.size > 10 * 1024 * 1024) {
showToast({ showToast({
message: '图片最大上传10M' message: "图片最大上传10M",
}) });
return false return false;
} }
this.imgList[index].imageFlag = true this.imgList[index].imageFlag = true;
this.$emit('input', this.imgList) this.$emit("input", this.imgList);
this.toBase64(file, index) this.toBase64(file, index);
}, },
// 上传图片到服务器 // 上传图片到服务器
uploadImage(params = {}, index, noSignAttr = ['file']) { uploadImage(params = {}, index, noSignAttr = ["file"]) {
// 上传url 测试 http://qcdidicb.glsx.com.cn:7060 线上 https://didicb.glsx.com.cn 开发 http://qcdidicb.dev.glsx.com.cn:7060 // 上传url 测试 http://qcdidicb.glsx.com.cn:7060 线上 https://didicb.glsx.com.cn 开发 http://qcdidicb.dev.glsx.com.cn:7060
const o = window.location const o = window.location;
const origin = o.origin const origin = o.origin;
let fileUploadURL = '' let fileUploadURL = "";
switch (origin) { switch (origin) {
case 'http://e-shield.didihu.com.cn': case "http://e-shield.didihu.com.cn":
fileUploadURL = 'https://didicb.glsx.com.cn' fileUploadURL = "https://didicb.glsx.com.cn";
break break;
case 'https://e-shield.didihu.com.cn': case "https://e-shield.didihu.com.cn":
fileUploadURL = `https://didicb.glsx.com.cn` fileUploadURL = `https://didicb.glsx.com.cn`;
break break;
case 'http://e-shield.glsx.com.cn': case "http://e-shield.glsx.com.cn":
fileUploadURL = `http://qcdidicb.glsx.com.cn:7060` fileUploadURL = `http://qcdidicb.glsx.com.cn:7060`;
break break;
case 'http://e-shield.dev.glsx.com.cn': case "http://e-shield.dev.glsx.com.cn":
fileUploadURL = `http://qcdidicb.dev.glsx.com.cn:7060` fileUploadURL = `http://qcdidicb.dev.glsx.com.cn:7060`;
break break;
default: default:
fileUploadURL = 'http://qcdidicb.dev.glsx.com.cn:7060' fileUploadURL = "http://qcdidicb.dev.glsx.com.cn:7060";
break break;
} }
const _this = this const _this = this;
params.source = 'glsx-oss-carowner' params.source = "glsx-oss-carowner";
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637' params.app_key = "48e5e13229b82c1b4e6e8c96151f0637";
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime();
params.v = '1.0.0' params.v = "1.0.0";
params.format = 'json' params.format = "json";
params.method = 'glsx.accounts.biz.common.pictureUpload' params.method = "glsx.accounts.biz.common.pictureUpload";
const data = sign(params, noSignAttr) const data = sign(params, noSignAttr);
axios axios
.post( .post(
`${fileUploadURL}/router?method=${params.method}`, `${fileUploadURL}/router?method=${params.method}`,
qs.stringify(data) qs.stringify(data)
) )
.then((res) => { .then((res) => {
_this.imgList[index].imageFlag = false _this.imgList[index].imageFlag = false;
_this.$emit('input', _this.imgList) _this.$emit("input", _this.imgList);
const response = res.data const response = res.data;
if (response.returnCode == 0) { if (response.returnCode == 0) {
_this.imgList[index].url = response.data _this.imgList[index].url = response.data;
_this.imgList[index].isUpdate = 1 // 重新上传后,是否新上传替换图片标识 _this.imgList[index].isUpdate = 1; // 重新上传后,是否新上传替换图片标识
// this.$emit("change", response.data); // this.$emit("change", response.data);
_this.$emit('input', _this.imgList) _this.$emit("input", _this.imgList);
} }
}) });
}, },
// 删除图片 // 删除图片
removeImage(row, index) { removeImage(row, index) {
// 数组中删除对应img // 数组中删除对应img
this.imgList[index].url = '' this.imgList[index].url = "";
this.$emit('input', this.imgList) this.$emit("input", this.imgList);
}, },
// 获取图片预览列表 // 获取图片预览列表
getPreViewList(url) { getPreViewList(url) {
const list = this.imgList || [] const list = this.imgList || [];
const arr = [] const arr = [];
list.map((k) => { list.map((k) => {
if (k.url) { if (k.url) {
if (k.url == url) { if (k.url == url) {
arr.unshift(k.url) arr.unshift(k.url);
} else { } else {
arr.push(k.url) arr.push(k.url);
} }
} }
}) });
return arr return arr;
},
// 获取classname 针对三码合一的修改特殊处理,其他图片显示遮罩层
getCellClass(row) {
console.log(this.imgFlag)
let idx = row.imageName.indexOf("三码合一");
if(this.imgFlag == 0){
return '';
} }
if (idx < 0 && this.imgFlag == 1) {
return "img_cell_blk";
} }
} },
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
.el_upload { .el_upload {
...@@ -182,6 +233,7 @@ export default { ...@@ -182,6 +233,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
} }
.img_cell { .img_cell {
position: relative;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-flow: column; flex-flow: column;
...@@ -215,10 +267,22 @@ export default { ...@@ -215,10 +267,22 @@ export default {
display: block; display: block;
} }
} }
.img_name{ .img_name {
width: 110px; width: 110px;
margin-top: 15px; margin-top: 15px;
color: #999; color: #999;
} }
} }
.img_cell_blk:after {
display: block;
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background:#fff;
z-index:2;
opacity: 0.5;
}
</style> </style>
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
<el-input :value="form.specialTagStr" disabled /> <el-input :value="form.specialTagStr" disabled />
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="是否加装" v-if="showFormItem">
<el-input :value="form.addFlag == 1?'是':'否'" disabled />
</el-form-item>
<el-form-item label="结算主体"> <el-form-item label="结算主体">
<el-input :value="form.tradeEntityStr" disabled /> <el-input :value="form.tradeEntityStr" disabled />
</el-form-item> </el-form-item>
...@@ -818,6 +821,7 @@ export default { ...@@ -818,6 +821,7 @@ export default {
orderSourceStr: "", orderSourceStr: "",
specialTagStr: "", specialTagStr: "",
tradeEntityStr: "", tradeEntityStr: "",
addFlag:""
}, },
rules: { rules: {
shopName: [ shopName: [
...@@ -949,6 +953,7 @@ export default { ...@@ -949,6 +953,7 @@ export default {
freshLoading: false, freshLoading: false,
pushTime: 120, pushTime: 120,
pushInterval: null, pushInterval: null,
showFormItem:false , // 是否展示加装工单选项
}; };
}, },
computed: { computed: {
...@@ -969,6 +974,7 @@ export default { ...@@ -969,6 +974,7 @@ export default {
} }
}, },
}, },
methods: { methods: {
resetForm() { resetForm() {
const form = this.form; const form = this.form;
...@@ -1013,9 +1019,16 @@ export default { ...@@ -1013,9 +1019,16 @@ export default {
form.orderSourceStr = ""; form.orderSourceStr = "";
form.specialTagStr = ""; form.specialTagStr = "";
form.tradeEntityStr = ""; form.tradeEntityStr = "";
form.addFlag = 0
}, },
openDialog() { openDialog() {
console.log(this.progressShow); console.log(this.progressShow);
let user = sessionStorage.getItem('user');
let info = user?JSON.parse(user):{};
// 针对平安特殊的账户,动态展示是否加装字段
if (info.username == "PAXM"||info.username == "paxm") {
this.showFormItem = true;
}
this.$emit("onOrderModalChange", true); this.$emit("onOrderModalChange", true);
this.resetForm(); this.resetForm();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!