Commit f247127f by 前端

Merge branch 'develop' into 'master'

上线合并

See merge request !29
2 parents 1e141835 6b7bd51e
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"ali-oss": "^6.23.0",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^2.1.0", "glsx-common": "^2.1.0",
"glsx-components": "^1.2.5", "glsx-components": "^1.5.4",
"rfdc": "^1.3.0", "rfdc": "^1.3.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
......
...@@ -222,4 +222,40 @@ const exportHeadTemplate = params => { ...@@ -222,4 +222,40 @@ const exportHeadTemplate = params => {
}) })
} }
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi, getQuotationPageApi, quotationFindByIdApi, exportOrderApi, quotationExportApi, quotationPrintApi, contractExportApi, listContracts, exportHeadTemplate } // 接车单、交车单上传记录保存
const carUploadRecordAdd = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.carUploadRecord.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 接车单、交车单上传记录删除
const carUploadRecordDelete = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.carUploadRecord.delete`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 接车单、交车单同步导出(生意助手用) 返回下载链接
const carUploadRecordExport = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.carUploadRecord.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi, getQuotationPageApi, quotationFindByIdApi, exportOrderApi, quotationExportApi, quotationPrintApi, contractExportApi, listContracts, exportHeadTemplate, carUploadRecordAdd, carUploadRecordDelete, carUploadRecordExport }
...@@ -98,8 +98,10 @@ export const payType = { ...@@ -98,8 +98,10 @@ export const payType = {
2: '4S店支付', 2: '4S店支付',
3: 'POS机收款', 3: 'POS机收款',
4: '支付宝支付', 4: '支付宝支付',
5: '嘀加收款' 5: '嘀加收款',
} 6: '对公转账',
7: '其他收款'
}
export const businessType = [ export const businessType = [
{ {
......
// import { baseConfig } from '@/main'
import { fetchConfig } from '@/config'
const OSS = require('ali-oss')
export default {
/**
* 阿里云oss sdk文件上传 dir 上传到的文件位置
* @param {*} file 文件流
* @param {*} successCallback 成功回调
* @param {*} errCallBack 失败回调
* @param {*} bucketName 阿里云桶名(可以指定多个桶名)
* @param {*} dir 上传文件夹路径 譬如images
*/
async bucketUpload(file, successCallback = new Function(), errCallBack = new Function(), bucketName = 'zzl-filerepostorypublic', dir = 'image') {
const baseConfig = await fetchConfig()
console.log('baseConfig', baseConfig)
const fileName = file.name // 先获取上传要的资料签名
// 实例化一个上传客户端
const client = new OSS({
// yourRegion填写Bucket所在地域。Region填写为oss-cn-hangzhou。
// region: "oss-cn-beijing", //我的存储是北京,可根据具体配置自行修改
// region: "oss-cn-shanghai",
// 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。)(后台接口返回)
accessKeyId: baseConfig.alyOss.accessKeyId,
accessKeySecret: baseConfig.alyOss.accessKeySecret,
// 从STS服务获取的安全令牌(SecurityToken)。
// stsToken: obj.securityToken,
// 填写Bucket名称。
bucket: baseConfig.alyOss.bucket,
endpoint: baseConfig.alyOss.endpoint
})
try {
// 为保证唯一性,可以通过uuid将文件名替换
// let uuid = uuidv4() + fileName.substring(fileName.lastIndexOf('.'))if (dir.substring(dir.length - 1, 1) !== '/') {
dir += '/'
const result = client.put(dir + fileName, file)
result
.then(res => {
console.log(res, '返回文件名和文件地址')
const size = file.size > 1000000 ? parseFloat(file.size / 1000000).toFixed(2) + 'M' : parseFloat(file.size / 1000).toFixed(2) + 'KB'
successCallback({
attachment: fileName,
aliyunAddress: res.url,
size: size
})
})
.catch(err => {
errCallBack(err)
})
} catch (e) {
console.log(e)
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!