Commit 93e6ccaa authored by 我在何方's avatar 我在何方

财务管理国际化

parents 5b189f21 d95d3878
const fs = require('fs');
const root = "./src"
const savePath = "./i18n-messages.txt"
const savePath = "./src/i18n/languages/en_US.json"
let allFiles = []
function getFiles(dir){
......@@ -29,6 +29,12 @@ allFiles.forEach(file => {
messages.add(item[1])
}
})
fs.writeFileSync("./i18n-messages.txt", Array.from(messages).join("\n"))
let obj = require(savePath)
Array.from(messages).forEach(word => {
if(!obj[word])obj[word] = ""
})
fs.writeFileSync(savePath, JSON.stringify(obj, null, 4))
console.log(messages)
console.warn(`共提取 ${messages.size} 个待翻译内容,保存于${savePath}`)
\ No newline at end of file
console.warn(`本次共提取 ${messages.size} 个待翻译内容,保存于${savePath}`)
\ No newline at end of file
......@@ -42,6 +42,7 @@
"dependencies": {
"@babel/parser": "^7.7.4",
"@riophae/vue-treeselect": "0.4.0",
"@vue/runtime-dom": "latest",
"axios": "0.24.0",
"bpmn-js-token-simulation": "^0.10.0",
"clipboard": "2.0.8",
......@@ -58,6 +59,7 @@
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"jspdf": "^2.5.1",
"min-dash": "^3.5.2",
"nprogress": "0.2.0",
"number-precision": "^1.5.2",
......@@ -77,8 +79,7 @@
"vuedraggable": "2.24.3",
"vuex": "3.6.0",
"xlsx": "^0.18.5",
"xml-js": "^1.6.11",
"@vue/runtime-dom": "latest"
"xml-js": "^1.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
......
......@@ -81,4 +81,9 @@ $sizes: 0, 10,20,30,50,100,150,200,300,500,800,1000;
width: #{$item}px !important;
}
}
table{
border-collapse: collapse;
border-spacing: 0;
}
</style>
......@@ -231,7 +231,7 @@ export function downloadByOrderId(orderId) {
url: "/shipment/make-bill-of-lading/downloadByOrderId",
method: "get",
params: { orderId },
responseType: "arraybuffer",
/* responseType: "arraybuffer", */
});
}
......
This diff is collapsed.
......@@ -204,7 +204,7 @@ export default {
}
this.currRow = row;
this.$set(this.dialogCfg, "type", type);
this.$set(this.dialogCfg, "width", "1000px");
this.$set(this.dialogCfg, "width", "1200px");
this.$set(this.dialogCfg, "visible", true);
},
makeBill(row) {
......
......@@ -19,11 +19,16 @@
<el-button plain type="primary" @click="showLoaingTemplate">{{$t('提单预览')}}</el-button>
</div>
<div v-if="currRow.status !== 1">
<el-button type="primary" @click="submit">{{$t('提交审核')}}</el-button>
<el-button type="primary" @click="createPdf">{{$t('提交审核')}}</el-button>
<el-button type="primary" @click="showLoaingTemplate">{{$t('提单预览')}}</el-button>
</div>
</el-row>
<!-- htm2canvas 容器 -->
<div style="height:0; overflow: hidden;">
<div id="html2canvas-container" v-html="billContent"></div>
</div>
<el-dialog :title="dialogCfg.title" :visible.sync="visible" width="1000px" append-to-body class="shippingSea-dialog">
<previewBill v-if="visible" :contentHtml="billContent" :currRow="currRow" :type="dialogCfg.type" />
</el-dialog>
......@@ -41,7 +46,9 @@ import {
import { serviceMsg, toReviewDetail } from "../shippingSea/utils";
import previewBill from "./previewBill.vue";
import { getToken } from "@/utils/auth";
import html2canvas from 'html2canvas';
import { jsPDF } from "jspdf";
import {uploadFile} from '@/api/infra/file'
export default {
name: "makeLadingBill",
components: {
......@@ -165,8 +172,35 @@ export default {
showLoaingTemplate() {
this.visible = true;
},
submit() {
createPdf(){
let loading = this.$loading()
html2canvas(document.querySelector("#html2canvas-container"), {dpi:144, useCORS: true}).then(canvas => {
const doc = new jsPDF('p','pt','a4',true);
const imgWidth = canvas.width
const imgHeight = canvas.height
let _w = 595.28;
let _h = 595.28/imgWidth*imgHeight;
if(_h>841.89){
_h = 841.89;
_w = _h/imgHeight*imgWidth
}
const _left = (595.28-_w)/2;
doc.addImage(canvas, 'PNG', _left, 0, _w,_h, '', 'FAST');
/* doc.save("a4.pdf");
return Promise.reject() */
let form = new FormData()
form.append('file', new File([doc.output('arraybuffer')], Date.now() + '.pdf', {type: 'application/pdf'}))
return uploadFile(form)
}).then(res => {
return this.submit(res.data)
}).finally(res => {
loading.close()
})
},
submit(imgUrl) {
let params = {
imgUrl,
billContent: this.billContent,
orderId: this.currRow.orderId,
copyUserId: this.selectedUsers,
......@@ -219,6 +253,16 @@ export default {
</script>
<style lang="scss" scoped>
::v-deep #html2canvas-container{
padding: 3rem;
word-break:initial;
p{
margin: 0;
}
td{
word-break:initial;
}
}
.shipping-makeLadingBill {
.title-orderNo {
text-align: center;
......
......@@ -608,12 +608,12 @@ export default {
this.errTips = {}
let discountDetailedVOs = this.costType == 3 ? this.fee[3] : this.fee[1].concat(this.fee[2]).filter(item => item.netReceiptsAmount || item.fullAmount)
discountDetailedVOs.map(item => {
if(item.combUnit){
// 目前只有满减使用组合单位
if(this.form.type == 2 && item.combUnit){
// 满减需要 先删除单位,防止编辑的时候切换单位导致两个同时存在
if(this.form.type == 2){
delete item.fullCurrencyId
delete item.prodUnit
}
delete item.fullCurrencyId
delete item.prodUnit
let tmp = item.combUnit.split('_')
item[tmp[0]] = tmp[1]
}
......
......@@ -19,7 +19,8 @@
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
<el-descriptions-item :label="$t('出货渠道')">
<dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>
{{ getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType||'').split(',')).map(e => e.label).join(', ') }}
<!-- <dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>-->
</el-descriptions-item>
<el-descriptions-item :label="$t('资源类型')">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" :value="customer.resourceType"></dict-tag>
......
......@@ -4,9 +4,10 @@
<i class="el-icon-loading" slot="icon" style="font-size: 40px" />
</el-result>
<pdf-viewer id="pdfViewer" ref="viewer" v-if="pdfData" :url="pdfData" style="display:block; margin: 0 auto; max-height: 80vh; overflow:auto;" />
<!-- <div v-if="detail" class="billcontent" v-html="detail.billContent"></div> -->
<p class="subs" style="text-align:center">
<el-button type="primary" @click="download" :disabled="!pdfData">{{$t('下载')}}</el-button>
<el-button type="primary" @click="print" :disabled="!pdfData">{{$t('打印')}}</el-button>
<el-button type="primary" @click="download" :disabled="!detail">{{$t('下载')}}</el-button>
<el-button type="primary" @click="print" :disabled="!detail">{{$t('打印')}}</el-button>
</p>
</el-dialog>
</template>
......@@ -17,7 +18,7 @@ import lodop from '@/utils/lodop'
import PdfViewer from '@/components/PdfViewer'
import FileSaver from 'file-saver'
import {downloadByOrderId} from '@/api/ecw/box'
import html2canvas from 'html2canvas'
export default {
components: {PdfViewer},
filters: {parseTime},
......@@ -34,9 +35,19 @@ export default {
billLadingNo: 'TD20220717',
type: 1, */
pdfData: null,
detail: null,
loading: false
}
},
watch:{
detail(){
/* this.pdfData = this.detail.imgUrl */
fetch(this.detail.imgUrl).then(async response => {
console.log(response)
this.pdfData = await response.arrayBuffer()
})
}
},
computed:{
title(){
let t = this.$t('提货单')
......@@ -59,9 +70,9 @@ export default {
loadData(){
this.loading = true
downloadByOrderId(this.orderId)
.then(arrayBuffer => {
console.log({arrayBuffer})
this.pdfData = arrayBuffer
.then(res => {
this.detail = res.data
/* this.pdfData = arrayBuffer */
})
.finally(() => {
this.loading = false
......@@ -71,9 +82,10 @@ export default {
this.show = false
this.$emit('close');
},
download(){
let blob = new Blob([this.pdfData], {type: "application/pdf"})
FileSaver.saveAs(blob, this.title + '.pdf');
FileSaver.saveAs(blob, this.title + '.pdf');
},
print(){
lodop().then(LODOP => {
......@@ -82,6 +94,7 @@ export default {
LODOP.SET_PRINT_STYLE("Bold",1);
LODOP.SET_PRINT_PAGESIZE(0);
LODOP.SET_PRINT_PAGESIZE(0,2100,2970,"A4");
// html2canvas(document.querySelector('.billcontent'))
let dataURLs = this.$refs.viewer.getDataURLs()
console.log(dataURLs)
for(let page in dataURLs){
......
......@@ -97,17 +97,17 @@
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w-100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item
......@@ -116,9 +116,9 @@
:prop="`priceStepList.${index}.allPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
</div>
</template>
......@@ -336,6 +336,7 @@ export default {
checkList: [],
selectedRoutes: [], // 勾选的路线渠道
form: {
minWeightUnit: undefined,
priceStepList: [], // 阶梯价格
specialList: []
},
......@@ -428,6 +429,9 @@ export default {
}
this.syncAllUnit()
},
'form.minWeightUnit'(minWeightUnit){
console.log('最小其计量单位', minWeightUnit)
},
'form.transportVolumeUnit'(transportVolumeUnit){
// 最小其计量
this.$set(this.form, 'minWeightUnit', transportVolumeUnit)
......@@ -456,6 +460,14 @@ export default {
},
'form.stepPrice'(stepPrice){
if(stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
/* let def = {
weightUnit: this.unitList[0].id,
allPriceUnit: this.currencyList[0].id,
transportPriceUnit: this.currencyList[0].id,
transportVolumeUnit: this.unitList[0].id,
clearancePriceUnit: this.currencyList[0].id,
clearanceVolumeUnit: this.unitList[0].id,
} */
this.$set(this.form, 'priceStepList', [{},{}])
}
this.syncAllUnit()
......@@ -543,7 +555,8 @@ export default {
validateEndDate: undefined,
validateStartDate: undefined,
clearancePrice: 0,
transportPrice: 0
transportPrice: 0,
minWeightUnit: null
}
// 默认体积单位(立方米)
this.setDefaultVolumeUnit(7)
......
......@@ -364,6 +364,8 @@
</el-card>
<el-form-item :label="$t('条款')" prop="contentZh">
<el-link type="primary" @click.native="setAgreementTpl('agreementSea')">海运模板</el-link> |
<el-link type="primary" @click.native="setAgreementTpl('agreementAir')">空运模板</el-link>
<ueditor v-model="ladingform.contentZh" :min-height="192" style="width:960px"/>
</el-form-item>
......@@ -649,6 +651,9 @@ export default {
setTpl(type){
this.ladingform.titleZh = tpl[type]
},
setAgreementTpl(type){
this.ladingform.contentZh = tpl[type]
},
/** 查询列表 */
getList() {
this.loading = true;
......
This diff is collapsed.
......@@ -341,15 +341,14 @@ export default {
},
methods: {
deleteFn(row){
console.log(row)
this.$modal.confirm(`${this.$t('是否要删除昵称为')}${row.nickname}的会员`).then(function (){
const nickname = row.nickname;
this.$modal.confirm(`${this.$t('是否确认删除昵称为{nickname}的会员?', {nickname})}`).then(function (){
return deleteUser(row.id)
}).then( res => {
if(res.code === 0) this.getList(); this.$message.success(this.$t('删除成功'))
}).catch(() =>{
this.$message.success(this.$t('删除失败'))
// this.$message.success(this.$t('删除失败'))
}
)
},
//导出
......
......@@ -180,12 +180,14 @@ export default {
},
methods: {
deleteFn(row){
this.$modal.confirm(`${this.$t('是否要删除昵称为')}${row.nickname}${this.$t('的会员')}`).then(function (){
// this.$modal.confirm(`${this.$t('是否要删除昵称为')}${row.nickname}${this.$t('的会员')}`).then(function (){
const nickname = row.nickname;
this.$modal.confirm(`${this.$t('是否确认删除昵称为{nickname}的会员?', {nickname})}`).then(function (){
return deleteUser(row.id)
}).then( res => {
if(res.code === 0) this.getList(); this.$message.success(this.$t('删除成功'))
}).catch(() =>{
this.$message.success(this.$t('删除失败'))
// this.$message.f(this.$t('取消删除'))
}
)
......
......@@ -43,8 +43,8 @@
<el-table-column label="" align="center" prop="id" />
<el-table-column label="标题中文" align="center" prop="titleZh" />
<el-table-column label="标题英文" align="center" prop="titleEn" />
<el-table-column label="内容中文" align="center" prop="contentZh" />
<el-table-column label="内容英语" align="center" prop="contentEn" />
<!-- <el-table-column label="内容中文" align="center" prop="contentZh" />-->
<!-- <el-table-column label="内容英语" align="center" prop="contentEn" />-->
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
......@@ -65,7 +65,11 @@
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<<<<<<< HEAD
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
=======
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
>>>>>>> d95d3878d23dd1546aa50a51bded6a000200cd21
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标题中文" prop="titleZh">
<el-input v-model="form.titleZh" placeholder="请输入标题中文" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment