Commit 83b088c1 authored by dcy's avatar dcy

Merge remote-tracking branch 'origin/dev' into dev

parents 84c870a3 e918ec48
......@@ -9,6 +9,13 @@
}
},
"exclude": [
"node_modules"
]
"node_modules",
"dist",
"bin",
"public",
"src/i18n/"
],
"vueCompilerOptions":{
"target": 2
}
}
\ No newline at end of file
......@@ -76,7 +76,8 @@
"vuedraggable": "2.24.3",
"vuex": "3.6.0",
"xlsx": "^0.18.5",
"xml-js": "^1.6.11"
"xml-js": "^1.6.11",
"@vue/runtime-dom": "latest"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
......
......@@ -50,7 +50,7 @@ export default {
padding: 50px;
text-align: center;
}
$sizes: 0, 10,20,30,50,100,150,200,500,800,1000;
$sizes: 0, 10,20,30,50,100,150,200,300,500,800,1000;
@for $i from 1 through length($sizes){
$item: nth($sizes, $i);
.ml-#{$item}{
......
......@@ -236,3 +236,19 @@ export function infoListReceiptPage(params){
})
}
// 获取用户
export function getMember(id){
return request({
url: "/member/user/get",
params: {id}
})
}
// 获得客户路线
export function getCustomerLines(customerId){
return request({
url: '/ecw/customer-line/get-by-customer',
params: {customerId}
})
}
......@@ -35,10 +35,11 @@ export function getProduct(id) {
}
// 获得产品列表
export function getProductList() {
export function getProductList(params) {
return request({
url: '/ecw/product/list',
method: 'get'
method: 'get',
params
})
}
......
......@@ -14,7 +14,7 @@
</div>
<div class="line">
<div class="label">电话:</div>
<div class="value">{{item.areaCode}} {{item.phoneNew}}</div>
<div class="value">+{{item.areaCode}} {{item.phoneNew}}</div>
</div>
<div class="line">
<div class="label">邮箱:</div>
......
......@@ -48,6 +48,7 @@ export default {
list:[],
queryParams:{
page: 1,
pageSize: 500,
searchKey: null,
// level: null
},
......@@ -86,7 +87,7 @@ export default {
}
getCustomerContactsSelect({ids: this.value.join(',')})
.then(res => {
this.$set(this, 'choosedList', res.data)
this.$set(this, 'choosedList', res.data.list)
})
},
reLoad(){
......@@ -96,7 +97,7 @@ export default {
},
getList(){
getCustomerContactsSelect(this.queryParams).then(res => {
this.list = res.data
this.list = res.data.list
})
},
choose(item){
......
<template>
<el-table
border
:data="tableData"
:data="exportWarehouseList"
style="">
<el-table-column
width="250px"
label="始发地">
<template v-slot="{ row, column, $index }">
<el-checkbox v-model="row.checked" @change="updateValue(true)">{{ warehouseList[$index].titleZh }}</el-checkbox>
<el-checkbox v-model="row.checked" @change="emit">{{ $l(row, 'title') }}</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="objectiveId"
label="目的地">
<template v-slot="{ row, column, $index }">
<el-select v-model="tableData[$index].objectiveIds" multiple placeholder="请选择" style="width:100%" @change="updateValue(row.checked)">
<el-select v-model="row.objectiveIdArr" multiple placeholder="请选择" style="width:100%" @change="emit">
<el-option
v-for="item in importCityList"
v-for="item in importWarehouseList"
:key="item.id"
:label="item.titleZh"
:label="$l(item, 'title')"
:value="item.id">
</el-option>
</el-select>
......@@ -41,64 +41,52 @@ export default {
},
data() {
return {
tableData: []
tableData: [],
importWarehouseList: [],
exportWarehouseList: []
}
},
mounted() {
this.freshTableData()
this.initLines()
},
methods: {
/**
* 解析 value
*/
freshTableData(){
const foo = []
let index = 0
this.warehouseList.forEach(e => {
let bar = this.tableData.length > 0 ? this.tableData[index] : {
departureId: e.id,
objectiveIds: [],
tradeType:e.tradeType,
checked: false
}
const valueIndex = this.value.findIndex(v => v.departureId === e.id)
if(valueIndex !== -1) {
bar = { ...this.value[valueIndex], checked: true }
if(bar.objectiveIds.length === 0) {
bar.objectiveIds = []
} else {
bar.objectiveIds = bar.objectiveIds.split(',').map(m => parseInt(m))
initLines(){
this.warehouseList.forEach(item => {
if(item.tradeType == 2 || item.tradeType == 3){
let oldItem = this.value.find(it => it.departureId == item.id)
this.exportWarehouseList.push(Object.assign({}, item, {
checked: !!oldItem,
objectiveIdArr: oldItem ? oldItem.objectiveIds.split(',').map(item => +item) : []
}))
}
if(item.tradeType == 1 || item.tradeType == 3){
this.importWarehouseList.push(Object.assign({}, item))
}
foo.push(bar)
index++
})
this.tableData = foo.filter(i => i.tradeType === '2');
},
/**
* 更新 value
*/
updateValue(really = true){
if (!really) return
const result = []
this.tableData.forEach(e => {
if(e.checked){
const { departureId } = e
let objectiveIds = e.objectiveIds.join(',')
result.push({ departureId, objectiveIds, zhongPaoType: this.zhongPaoType })
getValue(){
let arr = []
this.exportWarehouseList.forEach(item => {
if(item.checked){
arr.push({
objectiveIds: item.objectiveIdArr.join(','),
departureId: item.id,
zhongPaoType: this.zhongPaoType
})
}
})
this.$emit('input', result)
return arr
},
emit(){
this.$emit('input', this.getValue())
}
},
watch: {
value() {
this.freshTableData()
// this.freshTableData()
},
warehouseList() {
this.freshTableData()
this.initLines()
}
}
}
......
......@@ -46,6 +46,7 @@ export default {
list:[],
queryParams:{
page: 1,
pageSize: 500,
name: null,
level: null
},
......@@ -101,7 +102,7 @@ export default {
},
getList(){
getCustomerSelect(this.queryParams).then(res => {
this.list = res.data
this.list = res.data.list
})
},
choose(customer){
......
<template>
<div class="component-upload-image">
<ul class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-success" v-for="(item, index) in fileList" :key="index">
<video v-if="item.url.substr(-4) == '.mp4'" :src="item.url"></video>
<img v-else :src="item.url" :alt="item.name" class="el-upload-list__item-thumbnail">
<!-- <a class="el-upload-list__item-name">
<i class="el-icon-document"></i>
</a> -->
<label class="el-upload-list__item-status-label">
<i class="el-icon-upload-success el-icon-check"></i>
</label>
<!-- <i class="el-icon-close"></i>
<i class="el-icon-close-tip">按 delete 键可删除</i> -->
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(item)">
<i class="el-icon-zoom-in"></i>
</span>
<span class="el-upload-list__item-delete" @click="handleRemove(item)">
<i class="el-icon-delete"></i>
</span>
</span>
</li>
</ul>
<el-upload
multiple
:action="uploadImgUrl"
......@@ -11,7 +34,7 @@
:on-exceed="handleExceed"
name="file"
:on-remove="handleRemove"
:show-file-list="true"
:show-file-list="false"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
......@@ -34,10 +57,14 @@
width="800"
append-to-body
>
<template v-if="dialogImageUrl">
<video v-if="dialogImageUrl.substr(-4) == '.mp4'" :src="dialogImageUrl" controls autoplay style="display: block; max-width: 100%; margin: 0 auto"></video>
<img
v-else
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</template>
</el-dialog>
</div>
</template>
......@@ -49,7 +76,7 @@ export default {
props: {
value: [String, Object, Array],
// 图片数量限制
limit: {
limit2: {
type: Number,
default: 5,
},
......@@ -61,7 +88,7 @@ export default {
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
default: () => ["png", "jpg", "jpeg", 'mp4'],
},
// 是否显示提示
isShowTip: {
......@@ -81,7 +108,8 @@ export default {
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: []
fileList: [],
limit: 5
};
},
watch: {
......@@ -209,5 +237,10 @@ export default {
opacity: 0;
transform: translateY(0);
}
.component-upload-image{
display: flex;
flex-wrap: wrap;
}
</style>
<template>
<el-select
v-model="index"
filterable
clearable
remote
reserve-keyword
:placeholder="$t('请输入关键词')"
:remote-method="remoteMethod"
:loading="loading"
:size="size">
<el-option
v-for="(item, index) in list"
:key="item.id"
:label="`${item.nickname}(${item.mobile})`"
:value="index">
</el-option>
</el-select>
</template>
<script>
import {userMemberUserList, getMember} from '@/api/ecw/customer'
export default {
props:{
productType: [String, Number],
value: [String, Number],
size: String
},
data(){
return {
index: null,
list:[],
loading: false
}
},
watch:{
index(val){
this.$emit('input', (val!==''&&val !== null) ? this.list[val].id: null)
this.$emit('change', (val!==''&&val !== null) ? this.list[val]: null)
},
value(val){
this.init()
}
},
created(){
this.init()
},
methods:{
init(){
if(!this.value) return
let index = this.list.findIndex(item => item.id == this.value)
if(index < 0){
getMember(this.value).then(res => {
if(!res.data) rurn
this.list.unshift(res.data)
this.index = 0
})
}
},
remoteMethod(keyword){
let params = {
pageSize: 100
}
params.searchKey = keyword
this.loading = true
userMemberUserList(params)
.then(res => this.list = res.data.list)
.finally(() => this.loading = false)
}
}
}
</script>
......@@ -40,20 +40,19 @@ export default {
}
},
watch:{
index(val){
index(val, oldVal){
let productId = val !== '' && val !== null ? this.list[val].id : null
console.log('index val', val, productId)
// console.log('index val', val, oldVal, productId)
this.$emit('input', productId)
this.$emit('change', val !== '' && val !== null ? this.list[val] : null)
// 0 != '' 是 false
},
value(val){
console.log('初始化内容', val)
// console.log('初始化内容', val)
this.init()
}
},
created(){
console.log('created', this.value)
// console.log('created', this.value, this.lang)
this.init()
},
methods:{
......
......@@ -41,7 +41,7 @@
</div>
</template>
<script>
import { getProductPage } from '@/api/ecw/product'
import { getProductPage, getProductList } from '@/api/ecw/product'
import { getProductTypeList } from '@/api/ecw/productType'
import { getProductAttrList } from '@/api/ecw/productAttr'
......@@ -53,7 +53,8 @@ export default {
return []
}
},
showAll: Boolean
showAll: Boolean,
isall: Boolean
},
data() {
return {
......@@ -94,6 +95,14 @@ export default {
},
isAllProduct(isAllProduct){
this.$emit('setall', isAllProduct)
},
defaultIds(newValue, oldValue){
if(!oldValue || !oldValue.length){
this.loadDefaultProds()
}
},
isall(isall){
this.isAllProduct = isall
}
},
created() {
......@@ -101,11 +110,26 @@ export default {
getProductAttrList().then(res => this.attrList = res.data)
this.reLoad()
this.ids = this.defaultIds //数据回显
this.isAllProduct = this.isall
// 如果有默认商品则获取内容供回显
if(this.defaultIds.length){
this.loadDefaultProds()
}
},
methods: {
/* setAllProduct(status){
this.isAllProduct = true
}, */
loadDefaultProds(){
if(!this.defaultIds || !this.defaultIds.length){
return false
}
getProductList({ids: this.defaultIds.join(',')}).then(res => {
res.data.forEach(item => {
this.choose(item)
})
})
},
toggleAll(status){
this.list.forEach(item => {
this.toggleCheck(item, status)
......@@ -129,8 +153,8 @@ export default {
this.page = res.data.page
this.pages = res.data.pages
this.total = res.data.total
this.choosedList = [] //搜搜重置,数据回显
if (this.defaultIds.length > 0) {
// this.choosedList = [] //搜搜重置,数据回显
/* if (this.defaultIds.length > 0) {
this.defaultIds.map(item => {
this.list.map(items => {
if (items.id == item) {
......@@ -138,7 +162,7 @@ export default {
}
})
})
}
} */
})
},
toggleCheck(item, checked) {
......
......@@ -90,7 +90,7 @@ export default {
setInterval(() => {
this.$store.dispatch('getNotMessage');
this.$store.dispatch('getToDoList');
}, 3000)
}, 10000)
},
components: {
Breadcrumb,
......
......@@ -180,6 +180,7 @@ export const DICT_TYPE = {
NEED_KNOW_STATUS:'need_know_status',//需知状态
MANUAL_EXCEPTION_TYPE:'manual_exception_type',
APPLY_STATUS:'apply_status',//特价申请审核状态
WAREHOUSING_SPECIFICATION_TYPE: 'warehousing_specification_type',
ECASH_INIT:'ecash_init', //e-cash
FEE_TYPE:'receivable_fee_type',
......@@ -198,6 +199,7 @@ export const DICT_TYPE = {
BOX_SHIPPING_PRICE_UNIT: 'shipping_price_unit', // 金额单位
BOX_SHIPPING_TICKET_EXCEPTION: 'shipping_ticket_exception', // 票异常
BOX_SHIPPING_PROCESS: 'shipping_process', // 海运出货流程
BOX_SEA_AIR: 'shipping_process_sea_air', // 海空联运流程流程
BOX_SHIPPING_BRAND_TYPE: 'shipping_brand_type', // 出货品牌类型
BOX_SHIPPING_NOTICE_TYPE: 'shipping_notice_type', // 出货通知类型
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state'
......
......@@ -3,9 +3,12 @@
<el-form ref="costForm" :model="costObj" :rules="rules" label-width="80px">
<el-form-item :label="$t('操作步骤')" prop="opStepType">
<el-select v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')">
<el-select v-if="flag=='sea'" v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PROCESS)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
</el-select>
<el-select v-if="flag=='seaAir'" v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('费用类型')" prop="costType">
......@@ -26,7 +29,7 @@
</el-form-item>
<el-form-item label="" label-width="0px" prop="priceUnit">
<el-select v-model="costObj.priceUnit" :placeholder="$t('请选择单位')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PRICE_UNIT)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
<el-option v-for="type in this.currencyList" :key="type.id" :label="$l(type, 'title')" :value="type.id"></el-option>
</el-select>
</el-form-item>
</el-row>
......@@ -47,6 +50,7 @@
import { getSupplierPage } from "@/api/ecw/supplier";
import { createCost } from "@/api/ecw/box";
import { serviceMsg } from "./shippingSea/utils";
import { getCurrencyList } from "@/api/ecw/currency";
export default {
name: "costForm",
......@@ -57,6 +61,7 @@ export default {
costObj: {},
// 供应商
allSupplier: [],
currencyList: [],
rules: {
opStepType: [{ required: true, message: this.$t("操作步骤不能为空"), trigger: "change" }],
......@@ -65,6 +70,7 @@ export default {
price: [{ required: true, message: this.$t("金额不能为空"), trigger: "blur" }],
priceUnit: [{ required: true, message: this.$t("金额单位不能为空"), trigger: "blur" }]
},
flag: 'sea'
};
},
created() {
......@@ -75,6 +81,12 @@ export default {
});
const { costDetail } = this.$attrs;
this.costObj = { ...costDetail };
getCurrencyList().then((res) => {
this.currencyList = res.data ?? [];
});
if(this.$attrs.shipmentObj.bosType == 'seaAir'){
this.flag = 'seaAir';
}
},
methods: {
submit() {
......
......@@ -214,7 +214,7 @@ import editForm from "./editForm.vue";
import ladingBill from "./ladingBill/index.vue";
export default {
name: "indexSea",
name: "EcwBoxIndexsea",
components: {
costForm,
regError,
......
......@@ -320,7 +320,7 @@ import editForm from './editSeaAirForm.vue'
import ladingBill from "./ladingBill/index.vue";
export default {
name: 'box',
name: 'EcwBoxIndexseaair',
components: {
costForm,
regError,
......@@ -621,6 +621,7 @@ export default {
}
if (["editLadingBill", "cost", "error"].includes(command)) {
this.currRow = row;
this.currRow.bosType = 'seaAir'
this.$set(this.dialogCfg, "dialogType", command);
this.$set(this.dialogCfg, "width", "600px");
this.$set(this.dialogCfg, "open", true);
......
......@@ -118,7 +118,7 @@ export default {
dialogCfg: {
title: "",
type: "",
width: "80%",
width: "100px",
// 是否显示弹出层
visible: false,
fullscreen: false,
......@@ -158,6 +158,9 @@ export default {
if (type === "query") {
this.getBillList();
}
if(type === 'close'){
this.$emit("closeDialog");
}
},
handleCommand(type, row) {
switch (type) {
......@@ -198,7 +201,7 @@ export default {
}
this.currRow = row;
this.$set(this.dialogCfg, "type", type);
this.$set(this.dialogCfg, "width", "750px");
this.$set(this.dialogCfg, "width", "1000px");
this.$set(this.dialogCfg, "visible", true);
},
makeBill(row) {
......
......@@ -4,7 +4,7 @@
<div class="title-orderNo">{{$t('订单号')}}{{orderNo}}</div>
</el-row>
<el-row class="ueditor-row">
<vue-ueditor-wrap v-model="billContent" :config="editorConfig" editor-id="billUeditor" style="max-width: 690px;" />
<vue-ueditor-wrap v-model="billContent" :config="editorConfig" editor-id="billUeditor" />
</el-row>
<!-- 审核流程 -->
......@@ -71,7 +71,7 @@ export default {
"redo", //重做
"bold", //加粗
"indent", //首行缩进
"snapscreen", //截图
//"snapscreen", //截图
"italic", //斜体
"underline", //下划线
"strikethrough", //删除线
......@@ -86,9 +86,9 @@ export default {
"preview", //预览
"horizontal", //分隔线
"removeformat", //清除格式
"time", //时间
"date", //日期
"unlink", //取消链接
//"time", //时间
//"date", //日期
//"unlink", //取消链接
"insertrow", //前插入行
"insertcol", //前插入列
"mergeright", //右合并单元格
......@@ -104,7 +104,7 @@ export default {
"deletetable", //删除表格
"cleardoc", //清空文档
"insertparagraphbeforetable", //"表格前插入行"
"insertcode", //代码语言
//"insertcode", //代码语言
"fontfamily", //字体
"fontsize", //字号
"paragraph", //段落格式
......@@ -112,11 +112,11 @@ export default {
"insertimage", //多图上传
"edittable", //表格属性
"edittd", //单元格属性
"link", //超链接
"emotion", //表情
//"link", //超链接
//"emotion", //表情
"spechars", //特殊字符
"searchreplace", //查询替换
"insertvideo", //视频
//"searchreplace", //查询替换
//"insertvideo", //视频
"justifyleft", //居左对齐
"justifyright", //居右对齐
"justifycenter", //居中对齐
......@@ -131,25 +131,25 @@ export default {
"rowspacingtop", //段前距
"rowspacingbottom", //段后距
"pagebreak", //分页
"insertframe", //插入Iframe
//"insertframe", //插入Iframe
"imagenone", //默认
"imageleft", //左浮动
"imageright", //右浮动
"attachment", //附件
//"attachment", //附件
"imagecenter", //居中
"wordimage", //图片转存
"lineheight", //行间距
"edittip ", //编辑提示
//"edittip ", //编辑提示
"customstyle", //自定义标题
"autotypeset", //自动排版
"touppercase", //字母大写
"tolowercase", //字母小写
//"touppercase", //字母大写
//"tolowercase", //字母小写
"background", //背景
"scrawl", //涂鸦
"music", //音乐
//"scrawl", //涂鸦
//"music", //音乐
"inserttable", //插入表格
"drafts", // 从草稿箱加载
"charts", // 图表
//"charts", // 图表
],
],
serverUrl:
......@@ -201,6 +201,7 @@ export default {
this.$emit("closeDialog", type);
},
jumpReviewDetail() {
this.close('close')
const { bpmProcessId } = this.currData;
toReviewDetail.apply(this, [bpmProcessId]);
},
......@@ -221,7 +222,7 @@ export default {
.shipping-makeLadingBill {
.title-orderNo {
text-align: center;
font-size: 28px;
font-size: 18px;
font-weight: normal;
margin-bottom: 10px;
}
......@@ -245,4 +246,10 @@ export default {
justify-content: center;
}
}
.shippingSea-dialog{
::v-deep .el-dialog__body{
padding-top: 0;
}
}
</style>
......@@ -2,9 +2,12 @@
<div class="shippingSea-dialog">
<el-form ref="errorForm" :model="errorObj" label-width="140px">
<el-form-item :label="$t('操作步骤')">
<el-select v-model="errorObj.opStep" :placeholder="$t('请选择操作步骤')">
<el-select v-if="flag=='sea'" v-model="errorObj.opStep" :placeholder="$t('请选择操作步骤')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PROCESS)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
</el-select>
<el-select v-if="flag=='seaAir'" v-model="errorObj.opStep" :placeholder="$t('请选择操作步骤')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('票异常')">
<el-select v-model="errorObj.billAbnId" :placeholder="$t('请选择票异常')">
......@@ -63,11 +66,15 @@ export default {
label: this.$t(""),
},
],
flag: 'sea'
};
},
created() {
const { currNode } = this.$attrs;
this.errorObj = { opStep: currNode?.dataKey ?? undefined };
if(this.$attrs.shipmentObj.bosType == 'seaAir'){
this.flag = 'seaAir';
}
},
methods: {
/** 提交 */
......
......@@ -52,7 +52,8 @@
</div>
</el-form-item>
<el-form-item label="*运费" v-if="[2,3,4,5,6,7].indexOf(form.type) > -1">
<el-form-item label="运费" v-if="[2,3,4,5,6,7].indexOf(form.type) > -1">
<span slot="label"><span style="color: red">*</span>运费</span>
<div class="fee-item" v-for="(item, index) in fee[1]" :key="index">
<template v-if="[1,2,3,4,5].indexOf(form.type) > -1">
{{$t('')}}
......@@ -178,7 +179,8 @@
prop="suitableLineType"
v-if="form.type != 1"
>
<dict-selector :type="DICT_TYPE.ECW_SUITABLE_LINE_TYPE" v-model="form.suitableLineType" />
<!---第一个不是全部,所以不能使用defaultable-->
<dict-selector :type="DICT_TYPE.ECW_SUITABLE_LINE_TYPE" v-model="form.suitableLineType" formatter="number" />
<routers-selector v-if="showRouterSelector" v-model="form.lineIds" style="margin-top:5px" />
</el-form-item>
<el-form-item
......@@ -187,7 +189,7 @@
v-if="form.type != 1"
>
<!-- <dict-selector :type="DICT_TYPE.ECW_SUITABLE_PROD_TYPE" v-model="form.suitableProdType" /> -->
<products-selector v-model="form.prodIds" />
<products-selector v-model="form.prodIds" :default-ids="form.prodIds" show-all @setall="isAllProduct=$event" :isall="isAllProduct" />
</el-form-item>
<el-form-item
:label="$t('订单属性')"
......@@ -210,7 +212,7 @@
prop="brand"
v-if="form.type != 1"
>
<dict-selector form-type="checkbox" :type="DICT_TYPE.BRAND_REG_TYPE" v-model="form.brandArr" multiple />
<dict-selector form-type="checkbox" :type="DICT_TYPE.BOX_SHIPPING_BRAND_TYPE" v-model="form.brandArr" multiple />
</el-form-item>
<el-form-item
:label="$t('是否控货')"
......@@ -285,7 +287,8 @@ export default {
1: [],
2: [],
3: []
}
},
isAllProduct: false, // 是否全部商品
};
},
computed:{
......@@ -358,6 +361,7 @@ export default {
this.$set(this.form, 'isCargoControlArr', ["0"])
this.$set(this.form, 'orderAttrArr', ["2","3","1"])
this.$set(this.form, 'brandArr', ["0","1"])
this.$set(this.form, 'suitableLineType', 0)
}
},
'form.isSimilarSuperposition'(val){
......@@ -392,6 +396,11 @@ export default {
if (this.$route.query.id) {
getCoupon(this.$route.query.id).then((res) => {
this.form = res.data
// 没有商品则表示全部
if(!this.form.prodIds){
this.isAllProduct = true
}
if(this.form.couponIds){
let couponIds = this.form.couponIds.split(',').filter(item => item && item != '')
console.log({couponIds})
......@@ -420,6 +429,13 @@ export default {
if(this.$route.query.action == 'copy'){
this.form.couponId = null
}
// 对没有默认值的给一个空表单
[1,2].forEach(type => {
if(!this.fee[type].length){
this.fee[type] = [{type}]
}
})
})
}
// 不是编辑查看则给默认的费用表格
......@@ -506,6 +522,11 @@ export default {
data.costType = 3
}
// 没勾选全部就需要选择商品
if(!this.isAllProduct && !this.form.prodIds){
return this.$message.error('请选择商品')
}
// 修改的提交
if (data.couponId != null) {
updateCoupon(data).then((response) => {
......
......@@ -182,7 +182,7 @@
<el-col :span="24" v-show="showZhong">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showZhong1"></el-switch>
<customer-line-table v-show="showZhong1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="zhongLines" :zhong-pao-type="0"></customer-line-table>
<customer-line-table v-if="showZhong1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="zhongLines" :zhong-pao-type="1"></customer-line-table>
</el-form-item>
</el-col>
<el-col :span="13">
......@@ -196,7 +196,7 @@
<el-col :span="24" v-show="showPao">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showPao1"></el-switch>
<customer-line-table v-show="showPao1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="paoLines" :zhong-pao-type="1"></customer-line-table>
<customer-line-table v-if="showPao1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="paoLines" :zhong-pao-type="2"></customer-line-table>
</el-form-item>
</el-col>
</el-row>
......@@ -281,9 +281,10 @@
>
<template v-slot = "{row}">
<el-form-item label="">
<el-select v-model="row.userid" clearable remote :remote-method="getUserMemberUserFn" @change="selectBD" size="mini" filterable>
<!-- <el-select v-model="row.userid" clearable remote :remote-method="getUserMemberUserFn" @change="selectBD" size="mini" filterable>
<el-option v-for="(item,index) in userMemberUser" :value="item.id" :key="index" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
</el-select>
</el-select> -->
<MemberSelector v-model="row.userid" size="mini" />
</el-form-item>
</template>
</el-table-column>
......@@ -410,6 +411,7 @@ import {
getCustomerPage, memberUserList,
updateCustomer,
userMemberUserList,
getCustomerLines
} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType'
......@@ -424,7 +426,8 @@ import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template";
import {validatorMobile} from "@/api/ecw/validate"
import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
// import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
import MemberSelector from '@/components/MemberSelector'
export default {
name: "edit",
......@@ -434,13 +437,14 @@ export default {
components: {
Template,
upload,
CustomerLineTable
CustomerLineTable,
MemberSelector
},
created() {
this.isCustomerServiceConfirmed = this.$route.query.isCustomerServiceConfirmed ? true : false
this.getCustomerSelect()
this.reset()
this.getUserMemberUserFn()
// this.getUserMemberUserFn()
if(this.customerId !== '0') {
// 编辑客户
this.getCustomer(this.customerId).then(() => {
......@@ -458,6 +462,25 @@ export default {
})
}
})
// 打开重泡货开关
if(this.form.weightUnit){
this.showZhong = true
}
if(this.form.lightUnit){
this.showPao = true
}
// 获取重泡货路线
getCustomerLines(this.customerId).then(res => {
console.log({getCustomerLines: res})
this.zhongLines = res.data.filter(item => item.zhongPaoType == 1)
this.paoLines = res.data.filter(item => item.zhongPaoType == 2)
if(this.zhongLines.length)this.showZhong1 = true
if(this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer
// /admin-api/customer-line/get-by-customer?customerId=29564
})
})
} else {
// 新建客户
......@@ -545,11 +568,11 @@ export default {
},
methods: {
getUserMemberUserFn(val){
/* getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
this.memberList = r.data.list
})
},
}, */
remoteMethod(val){
this.getCustomerSelect(val);
},
......@@ -599,7 +622,7 @@ export default {
this.form.customerContacts[0].isDefault = 1
}
},
selectBD(val){
/* selectBD(val){
if(!val){
return
}
......@@ -607,8 +630,8 @@ export default {
if(i === undefined){
this.selectMemberList.push(this.memberList.find(item => item.id === val))
}
this.getUserMemberUserFn()
},
// this.getUserMemberUserFn()
}, */
/** 取消按钮 */
cancel() {
this.$tab.closePage()
......@@ -634,6 +657,17 @@ export default {
const form = {...this.form, type: this.form.type?.join(','), taxRate: Number(this.form.taxRate)}
// 检查路线是否启用了但是没选择目的仓
let errors = 0
form.customerLines.forEach(line => {
if(!line.objectiveIds || line.objectiveIds == ''){
errors ++
}
})
if(errors){
return this.$message.error('有两条路线未选择目的地')
}
// 修改的提交
if (this.form.id != null) {
this.form.customerContacts.forEach(e => {
......@@ -736,7 +770,7 @@ export default {
"position": "",
"social": undefined,
"socialNumber": "",
"userid": [],
"userid": undefined,
// "username": ""
})
},
......@@ -765,12 +799,12 @@ export default {
userId(){
return this.$store.state.user.id
},
userMemberUser(){
/* userMemberUser(){
let list = this.memberList.filter(item => {
return this.selectMemberList.findIndex(i => i.id === item.id) < 0
})
return [...this.selectMemberList,...list]
},
}, */
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
},
......@@ -788,11 +822,11 @@ export default {
},
watch: {
zhongLines() {
console.log('zhongLines')
console.log('zhongLines', this.zhongLines)
this.updateCustomerLines()
},
paoLines() {
console.log('paoLines')
console.log('paoLines', this.paoLines)
this.updateCustomerLines()
}
}
......
......@@ -720,7 +720,9 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm(this.$t('是否确认删除客户编号为"') + id + this.$t('"的数据项?')).then(function() {
const name = row.name;
const number = row.number;
this.$modal.confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')).then(function() {
return deleteCustomer(id);
}).then(() => {
this.getList();
......
......@@ -100,10 +100,14 @@
<el-input v-model="mingServantFrom[0].refund"></el-input>
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="mingServantFrom[0].refundCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="mingServantFrom[0].refundCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundUnit" label-key="titleZh" value-key="id"
:options="weightList"></custom-selectors-dictionary>
</div>
......@@ -133,8 +137,11 @@
<el-input v-model="item.darkCommission"></el-input>
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.darkCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="item.darkCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="item.darkCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.darkUnit" label-key="titleZh" value-key="id"
......@@ -158,8 +165,11 @@
<el-input v-model="item.amount"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.amountCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="item.amountCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="item.amountCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.amountUnit"
......@@ -172,8 +182,11 @@
<el-input v-model="item.refund"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="item.refundCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="item.refundCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.refundUnit"
......@@ -191,8 +204,11 @@
<el-input v-model="mingServantAnddarkServant[0].refund"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="mingServantAnddarkServant[0].refundCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="mingServantAnddarkServant[0].refundCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div class="item">
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="mingServantAnddarkServant[0].refundUnit"
......@@ -210,8 +226,11 @@
<el-input v-model="mingServantAnddarkServant[0].darkAdjustCommission"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
<el-select v-model="mingServantAnddarkServant[0].darkAdjustCurrency">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustCurrency"
:options="currencyList"></custom-selectors-dictionary> -->
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustUnit" label-key="titleZh" value-key="id"
......@@ -251,6 +270,8 @@ import CustomersSelector from "@/components/CustomersSelector";
import {getUnitList} from "@/api/ecw/unit";
import ChooseContactDialog from '@/components/ChooseContactDialog'
import {getProductTypeList} from "@/api/ecw/productType";
import { getCurrencyPage } from "@/api/ecw/currency";
export default {
name: "CustomerCommissionInfo",
components: {
......@@ -285,7 +306,7 @@ export default {
mingServantFrom: [
{
refund: '',
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundCurrency:null,
refundUnit:undefined,
}
],
......@@ -295,7 +316,7 @@ export default {
productType:0,//商品类型
productAttr: 0,//暗佣 产品属性
darkCommission: '',//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkCurrency: null,// 暗佣 货币
darkUnit:undefined,// 暗佣 单位
}
],
......@@ -303,10 +324,10 @@ export default {
darkServantAndRebateForm: [
{
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountCurrency:null,// 暗佣-满减金额对应货币
amountUnit:undefined,// 暗佣-满减金额对应单位,
refund: '',//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundCurrency:null,//暗佣-满之后返还金额的货币
refundUnit:undefined,//暗佣-满之后返还金额的单位
}
],
......@@ -314,10 +335,10 @@ export default {
mingServantAnddarkServant: [
{
refund: '',// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundCurrency: null,// 暗佣+明佣 上调对应的货币
refundUnit: undefined,//暗佣+明佣 上调对应的单位
darkAdjustCommission: '',//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustCurrency: null,//暗佣+明佣 上调对应的货币
darkAdjustUnit:undefined,//暗佣+明佣 上调对应的单位
}
],
......@@ -336,7 +357,12 @@ export default {
customerShow: true,
id:undefined,//佣金id
weightList:[],
productAttrList:[]
productAttrList:[],
params: {
page: 1,
rows: 20,
},
currencyList:[]
};
},
computed:{
......@@ -352,38 +378,50 @@ export default {
console.log(response.data,'response.data')
this.productAttrList = response.data
})
getCurrencyPage(this.params).then(res => {
this.currencyList = res.data.list
var id = this.currencyList[0].id
this.mingServantFrom[0].refundCurrency = id
this.darkServantAndProductForm[0].darkCurrency = id
this.darkServantAndRebateForm[0].amountCurrency = id
this.darkServantAndRebateForm[0].darkAdjustCurrency = id
this.mingServantAnddarkServant[0].refundCurrency = id
this.mingServantAnddarkServant[0].darkAdjustCurrency = id
})
//重量单位
getUnitList().then(r =>{
if(r.code === 0){
this.weightList = r.data
this.$set(this.mingServantFrom,0, {
refund: '',
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundCurrency:parseInt(this.currencyList[0].id),
refundUnit: parseInt(this.weightList[0].id),})
this.$set(this.darkServantAndProductForm, 0,
{
productType: 0,//商品类型
productAttr: 0,//暗佣 产品属性
darkCommission: '',//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkCurrency: parseInt(this.currencyList[0].id),// 暗佣 货币
darkUnit: parseInt(this.weightList[0].id),// 暗佣 单位
})
this.$set(this.darkServantAndRebateForm, 0,
{
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountCurrency:parseInt(this.currencyList[0].id),// 暗佣-满减金额对应货币
amountUnit:parseInt (this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: '',//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundCurrency:parseInt(this.currencyList[0].id),//暗佣-满之后返还金额的货币
refundUnit:parseInt(this.weightList[0].id),//暗佣-满之后返还金额的单位
})
this.$set(this.mingServantAnddarkServant, 0,
{
refund: '',// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundCurrency: parseInt(this.currencyList[0].id),// 暗佣+明佣 上调对应的货币
refundUnit: parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
darkAdjustCommission: '',//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustCurrency: parseInt(this.currencyList[0].id),//暗佣+明佣 上调对应的货币
darkAdjustUnit:parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
})
}
......@@ -481,16 +519,16 @@ export default {
productType:0,//商品类型
productAttr:0,//暗佣 产品属性
darkCommission: '',//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkCurrency: parseInt(this.currencyList[0].id),// 暗佣 货币
darkUnit:this.darkServantAndProductForm[0].darkUnit,// 暗佣 单位
})
}else {
this.darkServantAndRebateForm.push( {
amount: '',// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountCurrency:parseInt(this.currencyList[0].id),// 暗佣-满减金额对应货币
amountUnit: parseInt(this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: '',//暗佣-满之后返还金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundCurrency: parseInt(this.currencyList[0].id),//暗佣-满之后返还金额的货币
refundUnit: this.darkServantAndRebateForm[0].refundUnit,//暗佣-满之后返还金额的单位
})
}
......
......@@ -86,10 +86,7 @@
<el-table-column :label="$t('赔付金额')" align="center" prop="handleAt" width="180">
<template slot-scope="scope">
{{ scope.row.status === 3 ? scope.row.indemnity : '/'}}
<dict-tag
v-if="scope.row.status === 3"
:value="scope.row.currencyUnit"
:type="DICT_TYPE.COMMISSION_CURRENCY_TYPE"></dict-tag>
<span v-if="scope.row.status === 3">{{getCurrencyLabel(scope.row.currencyUnit)}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
......@@ -180,13 +177,9 @@
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('赔付金额')">
<el-input v-model="form.indemnity" :placeholder="$t('请输入赔付金额')">
<dict-selector
defaultable
style="width: 110px"
:placeholder="$t('请选择货币单位')"
slot="append"
v-model="form.currencyUnit"
:type="DICT_TYPE.COMMISSION_CURRENCY_TYPE"></dict-selector>
<el-select slot="append" defaultable v-model="form.currencyUnit" :placeholder="$t('请选择货币单位')" style="width: 110px">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
</el-input>
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('处理时间')" required>
......@@ -246,7 +239,7 @@
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('赔付金额')+':'">
<span>{{form.indemnity||0}}</span>
<dict-tag :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" :value="form.currencyUnit"></dict-tag>
<span>{{getCurrencyLabel(form.currencyUnit)}}</span>
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('处理时间')+':'">
<span>{{parseTime(form.handleAt)}}</span>
......@@ -280,13 +273,9 @@
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('赔付金额')">
<el-input v-model="form.indemnity" :placeholder="$t('请输入赔付金额')">
<dict-selector
defaultable
style="width: 110px"
:placeholder="$t('请选择货币单位')"
slot="append"
v-model="form.currencyUnit"
:type="DICT_TYPE.COMMISSION_CURRENCY_TYPE"></dict-selector>
<el-select slot="append" defaultable v-model="form.currencyUnit" :placeholder="$t('请选择货币单位')" style="width: 110px">
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
</el-input>
</el-form-item>
<el-form-item v-show="form.status == '3'" :label="$t('处理时间')" required>
......@@ -309,6 +298,8 @@ import DictSelector from '@/components/DictSelector'
import { DICT_TYPE, getDictDataLabel, getDictDatas } from '@/utils/dict'
import { getBillNoSearch, getOrderNoSearch } from '@/api/ecw/order'
import customerSelect from '@/views/ecw/customer/customerSelect'
import { getCurrencyPage } from "@/api/ecw/currency";
export default {
name: "CustomerComplaint",
/**
......@@ -375,11 +366,17 @@ export default {
},
billList: [],
orderList: []
orderList: [],
params: {
page: 1,
rows: 20,
},
currencyList:[]
};
},
created() {
this.getList();
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
},
methods: {
......@@ -391,7 +388,11 @@ export default {
}
})
},
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getOrderList(key){
getOrderNoSearch({key, pageNo: 1, pageSize: 20}).then(r => {
if (r.code === 0){
......
......@@ -124,20 +124,22 @@
</el-table-column>
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('优惠金额')" align="center">
<template slot-scope="scope">
<span> {{ scope.row.discountTotal ? `${scope.row.discountTotal}`:0}}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
<span v-if="scope.row.discountTotal">{{scope.row.discountRemark?('('+scope.row.discountRemark+')'): '' }}</span>
</template>
</el-table-column>
......@@ -169,7 +171,8 @@
:label="$t('核销基准币种')+':'"
style="margin-bottom: 0;margin-top: 20px;"
>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{getCurrencyLabel(showCurrencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> -->
</el-form-item>
<!-- </el-descriptions-item>
<el-descriptions-item :label="$t('核销基准币种')">
......@@ -264,7 +267,7 @@
<el-table :data="form.receiptAccountList" border :key="form.receiptAccountList.length">
<el-table-column :label="$t('应收币种')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('应收金额')" align="center" prop="receivableAmount">
......@@ -274,7 +277,7 @@
</el-table-column>
<el-table-column align="center" width="220">
<template #header>
{{ $t('核销基准币种') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />{{ $t('汇率') }}
{{ $t('核销基准币种') }}{{getCurrencyLabel(showCurrencyId)}}{{ $t('汇率') }}
</template>
<template slot-scope="scope">
<template v-if="scope.row.type !== 'total'">
......@@ -290,13 +293,13 @@
</el-form-item>
</template>
<template v-else>
{{ $t('应收总金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('应收总金额') }} {{getCurrencyLabel(showCurrencyId)}}
</template>
</template>
</el-table-column>
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t('核销基准金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('核销基准金额') }} {{getCurrencyLabel(showCurrencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center">
......@@ -343,11 +346,6 @@
:value="item.id"
/>
</el-select>
<!-- <dict-selector
:type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
v-model="scope.row.collectionCurrencyId"
@change="val => currencyIdChange(val, scope.row, scope.$index)"
/> -->
</el-form-item>
</template>
</el-table-column>
......@@ -367,11 +365,12 @@
</el-table-column>
<el-table-column :label="$t('期望收款金额')" align="center" prop="collectionAmount">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount.toFixed(6) }}</span>
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-for="itemAmount in scope.row.collectionAmount">{{itemAmount.currencyName}}: {{ itemAmount.amount}}</div>
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
</div>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
......@@ -555,14 +554,14 @@
<!-- <el-table-column label="单价美元" align="center" prop="unitPrice" /> -->
<el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
......@@ -609,32 +608,31 @@
</el-table-column>
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
<el-form-item :label="$t('总金额')">
{{ selectListRow.totalAmount }}
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="selectListRow.currencyId" />
{{ selectListRow.totalAmount }}{{getCurrencyLabel(selectListRow.currencyId)}}
</el-form-item>
<el-form-item :label="$t('优惠金额')">
<el-input v-model="discountForm.discountTotal" type="number" min="0" :max="selectListRow.totalAmount" @input="checkDiscount" style="width: 300px" ></el-input>
&nbsp;&nbsp;
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="selectListRow.currencyId" />
&nbsp;&nbsp;{{getCurrencyLabel(selectListRow.currencyId)}}
</el-form-item>
<el-form-item :label="$t('优惠原因')">
<el-input v-model="discountForm.discountRemark" type="textarea" style="width: 300px"></el-input>
</el-form-item>
<el-form-item :label="$t('优惠后')">
{{ (selectListRow.totalAmount - (discountForm.discountTotal || 0)).toFixed(2)}}
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="selectListRow.currencyId" />
{{getCurrencyLabel(selectListRow.currencyId)}}
</el-form-item>
<el-form-item v-if="opnotice" :label="$t('操作人')">
{{ discountForm.author }}
......@@ -746,25 +744,25 @@ export default {
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: [0, 0, 0]
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
const dollarList = this.list.filter(v => v.currencyId === 1)
const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
d && (d.discountTotal = discountDollar)
// const dollarList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
const rmbList = this.list.filter(v => v.currencyId === 2)
const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
r && (r.discountTotal = discountRmb)
// const rmbList = this.list.filter(v => v.currencyId === 2)
// const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
// r && (r.discountTotal = discountRmb)
const nairaList = this.list.filter(v => v.currencyId === 3)
const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
n && (n.discountTotal = discountNaira)
// const nairaList = this.list.filter(v => v.currencyId === 3)
// const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
// n && (n.discountTotal = discountNaira)
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
......@@ -848,6 +846,11 @@ export default {
}
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
checkDiscount(e){
if(e>this.selectListRow.totalAmount){
this.discountForm.discountTotal = this.selectListRow.totalAmount
......@@ -857,12 +860,13 @@ export default {
row.collectionCurrencyId = val
if (val == row.currencyId) row.collectionRate = 1
else {
if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB()
if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN()
if (row.currencyId == 3 && val == 1) row.collectionRate = this.RMBtoUS()
if (row.currencyId == 3 && val == 2) row.collectionRate = this.RMBtoNAN()
if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
// if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB()
// if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN()
// if (row.currencyId == 3 && val == 1) row.collectionRate = this.RMBtoUS()
// if (row.currencyId == 3 && val == 2) row.collectionRate = this.RMBtoNAN()
// if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
// if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
row.collectionRate = NP.divide(this.currencyList.find(v => v.id === row.currencyId).huilv, this.currencyList.find(v => v.id === val).huilv).toFixed(6)
}
this.rateChange(row, index)
......@@ -874,87 +878,118 @@ export default {
this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal
},
rateChange(row, index) {
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal)))
console.log(row)
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(6))
this.form.receiptAccountList[index] = {...row}
setTimeout(() => {
// 收款总计
const dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
const rmbList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 3)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
var amountList =[]
this.currencyList.forEach((item,index)=>{
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(6)
amountList.push({currencyName:item.titleZh,amount:dollar})
}
})
// const dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 1)
// const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
const nairaList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 2)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
// const rmbList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 3)
// const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = [dollar, rmb, naira]
// const nairaList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 2)
// const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
// const faList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == 6)
// const fa = faList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0)
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
}, 100)
},
calculation() {
const copyList = this.form.receiptAccountList
this.form.receiptAccountList = []
const dollarList = this.list.filter(v => v.currencyId === 1)
this.currencyList.forEach((item,index)=>{
var dollarList = this.list.filter(v => v.currencyId === item.id)
if(dollarList.length>0){
let dollar,discountDollar
if (dollarList.length > 0) {
dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const t = copyList.find(v => v.currencyId == 1)
this.form.receiptAccountList = [
var t = copyList.find(v => v.currencyId == item.id)
this.form.receiptAccountList.push(
{
discountTotal: discountDollar,
currencyId: 1,
currencyId: item.id,
receivableAmount: dollar,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? 1 : this.showCurrencyId === 2 ? this.UStoRMB() : this.UStoNAN()),
writeOffRate: t?.writeOffRate || NP.divide(this.currencyList.find(v => v.id === item.id).huilv, this.currencyList.find(v => v.id === this.showCurrencyId).huilv).toFixed(6),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || 1,
collectionCurrencyId: t?.collectionCurrencyId || item.id,
collectionRate: t?.collectionRate || 1
}
]
this.calculationCount(NP.minus(dollar, discountDollar), 1)
}
const rmbList = this.list.filter(v => v.currencyId === 2)
let rmb,discountRmb
if (rmbList.length > 0) {
rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const t = copyList.find(v => v.currencyId == 2)
this.form.receiptAccountList = [
...this.form.receiptAccountList,
{
discountTotal: discountRmb,
currencyId: 2,
receivableAmount: rmb,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.RMBtoUS() : this.showCurrencyId === 2 ? 1 : this.RMBtoNAN()),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || '',
collectionRate: t?.collectionRate || ''
}
]
this.calculationCount(NP.minus(rmb, discountRmb), 2)
}
const nairaList = this.list.filter(v => v.currencyId === 3)
let naira,discountNaira
if (nairaList.length > 0) {
naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const t = copyList.find(v => v.currencyId == 3)
this.form.receiptAccountList = [
...this.form.receiptAccountList,
{
discountTotal: discountNaira,
currencyId: 3,
receivableAmount: naira,
writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.NANtoUS() : this.showCurrencyId === 2 ? this.NANtoRMB() : 1),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: t?.collectionCurrencyId || '',
collectionRate: t?.collectionRate || '',
collectionAmount:discountNaira
}
]
this.calculationCount(NP.minus(naira, discountNaira), 3)
)
this.calculationCount(NP.minus(dollar, discountDollar), item.id)
}
})
// let dollar,discountDollar
// if (dollarList.length > 0) {
// dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 1)
// this.form.receiptAccountList = [
// {
// discountTotal: discountDollar,
// currencyId: 1,
// receivableAmount: dollar,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? 1 : this.showCurrencyId === 2 ? this.UStoRMB() : this.UStoNAN()),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || 1,
// collectionRate: t?.collectionRate || 1
// }
// ]
// this.calculationCount(NP.minus(dollar, discountDollar), 1)
// }
// const rmbList = this.list.filter(v => v.currencyId === 2)
// let rmb,discountRmb
// if (rmbList.length > 0) {
// rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 2)
// this.form.receiptAccountList = [
// ...this.form.receiptAccountList,
// {
// discountTotal: discountRmb,
// currencyId: 2,
// receivableAmount: rmb,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.RMBtoUS() : this.showCurrencyId === 2 ? 1 : this.RMBtoNAN()),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || '',
// collectionRate: t?.collectionRate || ''
// }
// ]
// this.calculationCount(NP.minus(rmb, discountRmb), 2)
// }
// const nairaList = this.list.filter(v => v.currencyId === 3)
// let naira,discountNaira
// if (nairaList.length > 0) {
// naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 3)
// this.form.receiptAccountList = [
// ...this.form.receiptAccountList,
// {
// discountTotal: discountNaira,
// currencyId: 3,
// receivableAmount: naira,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.NANtoUS() : this.showCurrencyId === 2 ? this.NANtoRMB() : 1),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || '',
// collectionRate: t?.collectionRate || '',
// collectionAmount:discountNaira
// }
// ]
// this.calculationCount(NP.minus(naira, discountNaira), 3)
// }
if (this.form.receiptAccountList.length > 0) {
// totalAmount
const totalt = this.form.receiptAccountList.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
......@@ -1091,16 +1126,25 @@ export default {
} else {
this.$modal.msgSuccess(this.$t('新增成功'));
}
// getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
// this.$set(this.list, this.selectListIndex, {...res.data})
// if(this.id>0){
// getInvoicingItem({ id: this.id }).then(res => {
// this.list = [...res.data]
// this.cancelDiscount()
// this.calculation()
// })
getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
// }else{
setTimeout(()=>{
getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
this.$set(this.list, this.selectListIndex, {...res.data})
this.cancelDiscount()
this.calculation()
})
},1000)
// }
})
},
getList() {
......
......@@ -181,7 +181,8 @@
<el-table-column :label="$t('应付金额')" align="center" prop="totalAmount" />
<el-table-column :label="$t('币种')" align="center" prop="currencyId">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="exchangeRate">
......@@ -197,6 +198,7 @@
<el-table-column :label="$t('价税合计(RMB)')" align="center" prop="total" >
<template slot-scope="scope">
<span>{{ scope.row.total = ((scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100)).toFixed(6) }}</span>
<!-- <span>{{scope.row.total}}</span> -->
</template>
</el-table-column>
</el-table>
......@@ -214,7 +216,6 @@
label=""
label-width="0"
style="margin-bottom: 0"
:error="$t('账单号不能为空')"
prop="accountNumber"
:rules="[
{ required: true, message: '账单号不能为空', trigger: 'blur' },
......@@ -386,8 +387,8 @@
</el-table-column>
<el-table-column :label="$t('金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
......@@ -523,6 +524,11 @@ export default {
},
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getList() {
this.loading = true;
// 处理查询参数
......@@ -542,6 +548,7 @@ export default {
});
},
getSummaries(param) {
console.log(param)
const { columns, data } = param;
const sums = new Array(columns.length).map(v => '');
const index = sums.length - 1
......@@ -619,6 +626,9 @@ export default {
},
selectChangeBank(val){
this.$forceUpdate()
var bank = this.bankData.find(item=>item.bankAccount==this.form.supplierBankAccount)
this.form.supplierBank = bank.bankName
this.form.supplierBankAccountName = bank.accountName
},
selectChange(val) {
this.bankData = []
......@@ -648,9 +658,8 @@ export default {
},
handleSelectionChange(val) {
this.multipleSelection = val.map(v => {
if(v.currencyId === 1) return Object.assign(v, { exchangeRate: this.UStoRMB() })
if(v.currencyId === 2) return Object.assign(v, { exchangeRate: 1 })
if(v.currencyId === 3) return Object.assign(v, { exchangeRate: this.NANtoRMB() })
var rate = NP.divide(this.currencyList.find(vs => vs.id === v.currencyId).huilv, 100).toFixed(6)
return Object.assign(v, { exchangeRate: rate })
});
},
hiddenDialog() {
......
......@@ -67,26 +67,26 @@
</el-table-column>
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('税额')" align="center" prop="tax">
<template slot-scope="scope">
<span>{{ scope.row.tax }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.tax }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('价税合计')" align="center" prop="taxAndTotalAmount">
<template slot-scope="scope">
<span>{{ scope.row.taxAndTotalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.taxAndTotalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
</el-table>
......@@ -113,6 +113,7 @@ import { DICT_TYPE } from "@/utils/dict";
import { getReceiptInvoicing, getInvoicingItem, updateReceiptInvoicing } from "@/api/ecw/financial";
import NP from 'number-precision'
export default {
name: "OpenInvoice",
components: {},
......@@ -121,7 +122,12 @@ export default {
loading: false,
invoiceData: {},
id: 0,
list: []
list: [],
params:{
page:1,
rows:20,
},
currencyList:[]
};
},
created() {
......@@ -129,8 +135,14 @@ export default {
this.id = this.$route.query.id;
this.getData();
}
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
async getData() {
this.loading = true;
await getReceiptInvoicing(this.id).then((res) => {
......
......@@ -141,7 +141,7 @@
<el-table-column :label="$t('金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{getCurrencyLabel(scope.row.currencyId)}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="创建时间" align="center" prop="channelName" />
......@@ -203,7 +203,7 @@
</el-form-item>
<el-form-item label="" label-width="0px">
<el-select v-model="costObj.currencyId" :placeholder="$t('请选择单位')">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PRICE_UNIT)" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-row>
......@@ -227,6 +227,7 @@ import { DICT_TYPE } from "@/utils/dict";
import { getTradeCityList } from "@/api/ecw/region";
import { getPayableList, deletePayable, updatePayable } from "@/api/ecw/financial"
import { getSupplierPage } from "@/api/ecw/supplier";
import { getCurrencyPage } from "@/api/ecw/currency";
export default {
name: "Payable",
......@@ -252,6 +253,7 @@ export default {
rows: 20,
},
allSupplier: [],
currencyList:[]
};
},
computed: {
......@@ -264,6 +266,7 @@ export default {
},
created() {
let that = this;
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
userList("salesman").then((res) => (that.creatorData = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getList()
......@@ -286,6 +289,11 @@ export default {
this.loading = false;
});
},
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
......
......@@ -154,14 +154,16 @@
<el-table-column :label="$t('应付金额')" align="center" prop="totalAmount" />
<el-table-column :label="$t('币种')" align="center" prop="currencyId">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="exchangeRate" />
<el-table-column :label="$t('税率%')" align="center" prop="taxRate" />
<el-table-column :label="$t('价税合计(RMB)')" align="center" prop="total" >
<template slot-scope="scope">
<span>{{ scope.row.total = ((scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100)).toFixed(6) }}</span>
<!-- <span>{{ scope.row.total = ((scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100)).toFixed(6) }}</span> -->
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
</el-table>
......@@ -326,6 +328,11 @@ export default {
},
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getList() {
this.loading = true;
// 处理查询参数
......
......@@ -16,7 +16,7 @@
{{ detail.applicationAt }}
</el-descriptions-item>
<el-descriptions-item :label="$t('供应商银行账号')" style="width: 50%">
{{ findBank(detail.supplierBankAccount) }}
{{ detail.supplierBankAccountName+'('+detail.supplierBankAccount+')' }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" class="card" border>
......@@ -49,7 +49,8 @@
<el-table-column :label="$t('应付金额')" align="center" prop="totalAmount" />
<el-table-column :label="$t('币种')" align="center" prop="currencyId">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="exchangeRate">
......@@ -88,6 +89,7 @@
<script>
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { listSimpleDepts } from "@/api/system/dept";
import { getCurrencyPage } from "@/api/ecw/currency";
import { getPaymentInfoByIds, getPaymentItem, paymentVerify } from "@/api/ecw/financial"
export default {
name: "CreatPayment",
......@@ -105,13 +107,16 @@ export default {
page: 1,
rows: 20,
},
currencyList:[],
deptData: [],
deptArr: [],
notes: ''
};
},
created() {
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
let that = this;
if (that.$route.query.id && that.$route.query.id !== '0') {
this.id = this.$route.query.id;
getPaymentInfoByIds({ id: this.id }).then(res => {
......@@ -146,6 +151,11 @@ export default {
});
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getSummaries(param) {
const { columns, data } = param;
const sums = new Array(columns.length).map(v => '');
......
......@@ -134,16 +134,16 @@
>
<template slot-scope="scope">
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" @click="handleAdd(scope.row.id)" type="text">{{ $t('编辑') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" type="text" @click="examineClick(scope.row.id)">{{ $t('审核') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" v-hasPermi="['ecw:payment:update']" type="text" @click="examineClick(scope.row.id)">{{ $t('审核') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" @click="verifyCancelClick(scope.row)">{{ $t('反审核') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" @click="verificationClick(scope.row)">{{ $t('核销') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verifyCancelClick(scope.row)">{{ $t('反审核') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verificationClick(scope.row)">{{ $t('核销') }}</el-button>
<el-button v-if="scope.row.state == 4" size="mini" type="text" @click="verificationCancelClick(scope.row)">{{ $t('反核销') }}</el-button>
<el-button v-if="scope.row.state == 4" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verificationCancelClick(scope.row)">{{ $t('反核销') }}</el-button>
<!-- <el-button v-if="scope.row.state == 3" size="mini" type="text">开票</el-button> -->
<el-button size="mini" type="text" @click="toprint(scope.row.id)">{{ $t('打印') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" type="text" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button>
<el-button size="mini" type="text" @click="toprint(scope.row.id)" v-hasPermi="['ecw:payment:query']">{{ $t('打印') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" type="text" v-hasPermi="['ecw:payment:delete']" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button>
<!-- <el-button size="mini" type="text" @click="open = true">导出订单</el-button> -->
</template>
</el-table-column>
......
......@@ -33,13 +33,14 @@
<table border="1" style="margin-top: 20px;width: 100%;text-align: center;border-collapse: collapse;line-height: 2 ">
<tr>
<th style="width: 6%;">{{ $t('序号') }}</th>
<th style="width: 15%;">{{ $t('自编号') }}</th>
<th style="width: 11%;">{{ $t('自编号') }}</th>
<th style="width: 15%;">{{ $t('费用类型') }}</th>
<th style="width: 15%;">{{ $t('币种') }}</th>
<th style="width: 10%;">{{ $t('币种') }}</th>
<th style="width: 10%;">{{ $t('汇率') }}</th>
<th style="width:10%;">{{ $t('税率') }}</th>
<th style="width: 15%;">{{ $t('发票号') }}</th>
<th style="width: 12%;">{{ $t('应付金额') }}</th>
<th style="width: 12%;">{{ $t('申请金额') }}</th>
<th style="width: 10%;">{{ $t('应付金额') }}</th>
<th style="width: 10%;">{{ $t('申请金额') }}</th>
</tr>
<tr v-for="(item, index) in list" :key="index">
<td>{{ index + 1 }}</td>
......@@ -50,10 +51,11 @@
:value="item.feeType"
></dict-tag>
</td>
<td>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="item.currencyId" />
<td>{{getCurrencyLabel(item.currencyId)}}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="item.currencyId" /> -->
</td>
<td>{{ item.exchangeRate }}</td>
<td>{{ item.taxRate }}</td>
<td>{{ item.invoiceNumber }}</td>
<td>{{ item.totalAmount }}</td>
<td>{{ item.total }}</td>
......@@ -88,6 +90,7 @@
import { listSimpleDepts } from "@/api/system/dept"
// import { getReceipt} from "@/api/ecw/receipt";
import { getPaymentInfoByIds, getPaymentItem } from "@/api/ecw/financial"
import { getCurrencyPage } from "@/api/ecw/currency";
import lodop from '@/utils/lodop'
export default {
......@@ -110,7 +113,8 @@
},
// deptData:[],
// deptArr:[],
id:0
id:0,
currencyList:[]
}
},
created() {
......@@ -119,6 +123,7 @@
that.id = that.$route.query.id
that.getCollectionData()
}
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
userList('salesman').then(res =>that.creatorData = res.data)
getBankAccountPage(that.params).then(res =>that.bankData = res.data.list)
// listSimpleDepts().then(res =>{
......@@ -142,6 +147,11 @@
// })
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getCollectionData(){
let that = this
getPaymentInfoByIds({id:that.id}).then(res =>{
......@@ -182,7 +192,7 @@
},
totalMoney() {
const t = this.list.map(v => v.total).reduce((prev, curr) => {
return prev + curr;
return parseFloat(prev) + parseFloat(curr);
}, 0)
return t
},
......
......@@ -40,17 +40,17 @@
<td>{{ item.titleZh }}</td>
<td><dict-tag :value="item.feeType" :type="DICT_TYPE.FEE_TYPE"></dict-tag></td>
<td> {{item.totalAmount}}</td>
<td><dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="item.currencyId" /></td>
<td>{{getCurrencyLabel(item.currencyId)}}</td>
<td>{{ item.discountTotal||0 }}</td>
</tr>
<tr v-for="(items, indexs) in receiptAccountList" :key="indexs">
<td><dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="items.currencyId" />{{$t('应收合计')}}</td>
<td>{{getCurrencyLabel(items.currencyId)}}{{$t('应收合计')}}</td>
<td ><span v-if="items.discountTotal>0">{{ `${items.receivableAmount - items.discountTotal }(${items.receivableAmount} - ${items.discountTotal})` }}</span>
<span v-else>{{ `${items.receivableAmount - items.discountTotal }` }}</span>
</td>
<td>{{$t('汇率')}}</td>
<td>{{ items.collectionRate}}</td>
<td>{{$t('收款金额')}}(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="items.collectionCurrencyId" />)</td>
<td>{{$t('收款金额')}}({{getCurrencyLabel(items.collectionCurrencyId)}})</td>
<td colspan="3">{{ items.collectionAmount}}</td>
</tr>
</table>
......@@ -64,7 +64,7 @@
<p style="margin: 0;word-break: break-all;">A/C NO{{bankTiem.accountNo}}</p>
</div>
<div style="padding:6px 0;width: 87.5%;text-align: center;">
<p style="margin: 0;">{{$t('实收')}}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="bankTiem.currencyId" />{{bankTiem.amount}}¥</p>
<p style="margin: 0;">{{$t('实收')}}{{getCurrencyLabel(bankTiem.currencyId)}}{{bankTiem.amount}}¥</p>
<!-- <p style="margin: 0;">未收:¥{{bankTiem.noReceipt}}</p> -->
</div>
</div>
......@@ -95,6 +95,7 @@
import lodop from '@/utils/lodop'
import NP from 'number-precision'
import {getOrder} from '@/api/ecw/order'
import { getCurrencyPage } from "@/api/ecw/currency";
import { getReceiptInfoByIds, getInvoicingItem,getReceiptAccountList,getReceivableItem} from "@/api/ecw/financial";
export default {
......@@ -121,13 +122,15 @@
id:0,
orderData:{},
detailed:[],
date:''
date:'',
currencyList:[]
}
},
async created() {
let that = this
// listSimpleUsers().then(res =>that.creatorData = res.data)
// getBankAccountPage(that.params).then(res =>that.bankData = res.data.list)
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await listSimpleDepts().then(res =>{
res.data.forEach((item)=>{
if(item.parentId==0){
......@@ -204,6 +207,11 @@
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getList() {
getReceivableItem({ id: this.id }).then(res => {
this.detailed = res.data
......
......@@ -41,13 +41,13 @@
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('优惠金额')" align="center">
......@@ -75,7 +75,7 @@
</el-select> -->
</el-descriptions-item>
<el-descriptions-item :label="$t('核销基准币种')">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{getCurrencyLabel(showCurrencyId)}}
</el-descriptions-item>
</el-descriptions>
</el-card>
......@@ -118,32 +118,32 @@
<el-table :data="form.receiptAccountList" border>
<el-table-column :label="$t('应收币种')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
</template>
</el-table-column>
<!-- <el-table-column label="应收金额" align="center" prop="receivableAmount" /> -->
<el-table-column :label="$t('应收金额')" align="center" prop="receivableAmount">
<template slot-scope="scope" v-if="scope.row.type !== 'total'">
<span v-if="scope.row.discountTotal>0">{{ `${scope.row.receivableAmount - scope.row.discountTotal }(${scope.row.receivableAmount} - ${scope.row.discountTotal})` }}</span>
<span v-else>{{ `${scope.row.receivableAmount - scope.row.discountTotal }` }}</span>
<span v-if="scope.row.discountTotal&&scope.row.discountTotal>0">{{ `${scope.row.receivableAmount - scope.row.discountTotal }(${scope.row.receivableAmount} - ${scope.row.discountTotal})` }}</span>
<span v-else>{{ `${scope.row.receivableAmount}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" width="220">
<template #header>
{{ $t('核销基准币种') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />{{ $t('汇率') }}
{{ $t('核销基准币种') }}{{getCurrencyLabel(showCurrencyId)}}{{ $t('汇率') }}
</template>
<template slot-scope="scope">
<template v-if="scope.row.type !== 'total'">
<span>{{ scope.row.writeOffRate }}</span>
</template>
<template v-else>
{{ $t('应收总金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('应收总金额') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
</template>
</el-table-column>
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t('核销基准金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('核销基准金额') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center">
......@@ -176,9 +176,10 @@
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div>
<div v-for="itemAmount in scope.row.collectionAmount">{{itemAmount.currencyName}}: {{ itemAmount.amount}}</div>
<!-- <div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div>
<div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1] }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div> -->
</div>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
......@@ -205,7 +206,7 @@
<el-card class="card">
<div slot="header" class="card-title">{{ $t('银行收款明细') }}</div>
<div>
<el-button type="primary" plain size="mini" @click="batchVerification" style="padding: 10px; margin-bottom: 10px">{{ $t('批量核销') }}</el-button>
<el-button type="primary" plain size="mini" @click="batchVerification" v-hasPermi="['ecw:verification:update']" style="padding: 10px; margin-bottom: 10px">{{ $t('批量核销') }}</el-button>
<el-button type="primary" plain size="mini" @click="handleAddReceiptItem" style="padding: 10px; margin-bottom: 10px">{{ $t('添加收款明细') }}</el-button>
</div>
<el-table ref="multipleTable" :data="detailed" border row-key="id" @selection-change="handleSelectionChange">
......@@ -215,7 +216,7 @@
<el-table-column :label="$t('实收金额')" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
{{getCurrencyLabel(scope.row.currencyId)}}
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" />
......@@ -240,8 +241,8 @@
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" type="text" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button>
<el-button type="text" @click="detailClick(scope.row)">{{ $t('详情') }}</el-button>
<el-button v-if="scope.row.status == 0" type="text" @click="verificationClick(scope.row)">{{ $t('核销') }}</el-button>
<el-button v-if="scope.row.status == 1" type="text" @click="verificationCancelClick(scope.row)">{{ $t('反核销') }}</el-button>
<el-button v-if="scope.row.status == 0" type="text" @click="verificationClick(scope.row)" v-hasPermi="['ecw:verification:update']">{{ $t('核销') }}</el-button>
<el-button v-if="scope.row.status == 1" type="text" @click="verificationCancelClick(scope.row)" v-hasPermi="['ecw:verification:update']">{{ $t('反核销') }}</el-button>
<el-button v-if="scope.row.status == 0" type="text" @click="editClick(scope.row)">{{ $t('编辑') }}</el-button>
</template>
</el-table-column>
......@@ -258,19 +259,19 @@
</template>
<div v-else>
<div v-for="(amount, currency) in writeOffTotal" :key="currency">
{{amount}}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="currency" />
{{amount}}{{getCurrencyLabel(currency)}}
</div>
</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{ $t('核销基准金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('核销基准金额') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
{{ writeOffAmount}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{ $t('已核销比例') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('已核销比例') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
{{ WriteOffProportion }}%
</el-descriptions-item>
......@@ -278,7 +279,7 @@
</el-card>
<div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="toEdit">{{ $t('编辑') }}</el-button>
<el-button type="primary" @click="verificationAll">{{ $t('全部核销') }}</el-button>
<el-button type="primary" @click="verificationAll" v-hasPermi="['ecw:verification:update']">{{ $t('全部核销') }}</el-button>
</div>
<el-dialog v-if="openAddDialog" :visible.sync="openAddDialog" :title="dialogTitle" width="40%" append-to-body>
<div style="padding: 0 24px">
......@@ -290,7 +291,7 @@
</template>
<div v-else>
<div v-for="(amount, currency) in surplusData" :key="currency">
<span v-if="amount"> {{amount}}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="currency" /></span>
<span v-if="amount"> {{amount}}{{getCurrencyLabel(currency)}}</span>
</div>
</div>
......@@ -355,7 +356,7 @@
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('汇率不能为空') }"
>
<template slot="label">
{{ $t('汇率') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('汇率') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
<el-input v-if="!isView" v-model="addForm.rate" style="width: 220px"></el-input>
<span v-else>{{ addForm.rate}}</span>
......@@ -364,7 +365,7 @@
v-if="showCurrencyId != addForm.currencyId"
>
<template slot="label">
{{ $t('金额') }}<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />
{{ $t('金额') }}{{getCurrencyLabel(showCurrencyId)}}
</template>
<span>{{ addForm.writeOffAmount?parseFloat(addForm.writeOffAmount).toFixed(6):'' }}</span>
</el-form-item>
......@@ -509,18 +510,19 @@ export default {
this.detailed.forEach(item => {
total = NP.plus(total, item.writeOffAmount)
})
return total.toFixed(6)
return total.toFixed(2)
},
WriteOffProportion(){
let total = 0
let amountTotal = 0
let amountTotal = this.form.receiptAccountList.find(item=>item.type=='total').writeOffAmount
this.detailed.forEach(item => {
if(item.status){
amountTotal = NP.plus(amountTotal, item.writeOffAmount)
}
// if(item.status){
// amountTotal = NP.plus(amountTotal, item.writeOffAmount)
// }
total = NP.plus(total, item.writeOffAmount)
})
let portion = NP.divide(amountTotal,total)
let portion = NP.divide(total,amountTotal)
return (portion*100).toFixed(2)
}
},
......@@ -575,43 +577,64 @@ export default {
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: [0, 0, 0]
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
// 收款总计
const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
// const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
// const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const rmbList = res.data.filter(v => v.collectionCurrencyId == 3)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
// const rmbList = res.data.filter(v => v.collectionCurrencyId == 3)
// const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const nairaList = res.data.filter(v => v.collectionCurrencyId == 2)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
// const nairaList = res.data.filter(v => v.collectionCurrencyId == 2)
// const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
// res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
// this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
const dollarListByList = this.list.filter(v => v.currencyId === 1)
const discountDollar = dollarListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const d = res.data.find(v => v.currencyId == 1)
d && (d.discountTotal = discountDollar)
// const dollarListByList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = res.data.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
// const rmbListByList = this.list.filter(v => v.currencyId === 3)
// const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = res.data.find(v => v.currencyId == 3)
// r && (r.discountTotal = discountRmb)
const rmbListByList = this.list.filter(v => v.currencyId === 3)
const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const r = res.data.find(v => v.currencyId == 3)
r && (r.discountTotal = discountRmb)
const nairaListByList = this.list.filter(v => v.currencyId === 2)
const discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const n = res.data.find(v => v.currencyId == 2)
// 收款总计
var amountList =[]
this.currencyList.forEach((item,index)=>{
var nairaListByList = this.list.filter(v => v.currencyId === item.id)
if(nairaListByList.length>0){
var discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
var n = res.data.find(v => v.currencyId == item.id)
n && (n.discountTotal = discountNaira)
}
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2)
if(n.discountTotal&&n.discountTotal>0){
amountList.push({currencyName:item.titleZh,amount:(dollar-n.discountTotal).toFixed(2)})
}else{
amountList.push({currencyName:item.titleZh,amount:dollar})
}
}
})
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// this.form.receiptAccountList.forEach((item, index) => {
// this.rateChange(item, index)
// });
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
})
})
}
......@@ -619,6 +642,11 @@ export default {
this.getList()
},
methods: {
rateChange(row, index) {
console.log(row)
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2))
this.form.receiptAccountList[index] = {...row}
},
setWriteOffAmount() {
this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0))
},
......@@ -628,13 +656,35 @@ export default {
return ''
},
calculation() {
const verificationList = this.detailed.filter(v => v.status === 1)
const dollarList = verificationList.filter(v => v.currencyId === 1)
const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const rmbList = verificationList.filter(v => v.currencyId === 3)
const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
const nairaList = verificationList.filter(v => v.currencyId === 2)
const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// this.currencyList.forEach((item,index)=>{
// var verificationList = this.detailed.filter(v => v.status === 1)
// var dollarList = verificationList.filter(v => v.currencyId === item.id)
// if(dollarList.length>0){
// let dollar,discountDollar
// dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// var t = copyList.find(v => v.currencyId == item.id)
// this.form.receiptAccountList.push(
// {
// discountTotal: discountDollar,
// currencyId: item.id,
// receivableAmount: dollar,
// writeOffRate: t?.writeOffRate || NP.divide(this.currencyList.find(v => v.id === item.id).huilv, this.currencyList.find(v => v.id === this.showCurrencyId).huilv).toFixed(6),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || item.id,
// collectionRate: t?.collectionRate || 1
// }
// )
// this.calculationCount(NP.minus(dollar, discountDollar), item.id)
// }
// })
// const verificationList = this.detailed.filter(v => v.status === 1)
// const dollarList = verificationList.filter(v => v.currencyId === 1)
// const dollar = dollarList.length > 0 ? dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// const rmbList = verificationList.filter(v => v.currencyId === 3)
// const rmb = rmbList.length > 0 ? rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// const nairaList = verificationList.filter(v => v.currencyId === 2)
// const naira = nairaList.length > 0 ? nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.amount || 0), 0) : 0
// const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira))
// const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira))
......@@ -643,41 +693,41 @@ export default {
// this.verificationData.usCount = usCount
// this.verificationData.rmbCount = rmbCount
// this.verificationData.nairaCount = nairaCount
this.verificationData.usCount = dollar
this.verificationData.rmbCount = rmb
this.verificationData.nairaCount = naira
// this.verificationData.usCount = dollar
// this.verificationData.rmbCount = rmb
// this.verificationData.nairaCount = naira
if (verificationList.indexOf(1)>-1) { // 美元
this.verificationData.writtenOff = dollar
this.verificationData.WriteOffProportion = NP.times(NP.divide(dollar, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, dollar)
// if (verificationList.indexOf(1)>-1) { // 美元
// this.verificationData.writtenOff = dollar
// this.verificationData.WriteOffProportion = NP.times(NP.divide(dollar, this.form.receivableTotalAmount), 100)
// const remaining = NP.minus(this.form.receivableTotalAmount, dollar)
// this.remainingAmount = {
// usAmount: remaining,
// rmbAmount: NP.times(this.UStoRMB(), remaining),
// nairaAmount: NP.times(this.UStoNAN(), remaining)
// }
this.remainingAmount.usAmount = remaining
} else if (this.showCurrencyId === 2) { // 人民币
this.verificationData.writtenOff = rmb
this.verificationData.WriteOffProportion = NP.times(NP.divide(rmb, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, rmb)
// this.remainingAmount.usAmount = remaining
// } else if (this.showCurrencyId === 2) { // 人民币
// this.verificationData.writtenOff = rmb
// this.verificationData.WriteOffProportion = NP.times(NP.divide(rmb, this.form.receivableTotalAmount), 100)
// const remaining = NP.minus(this.form.receivableTotalAmount, rmb)
// this.remainingAmount = {
// usAmount: NP.times(this.RMBtoUS(), remaining),
// rmbAmount: remaining,
// nairaAmount: NP.times(this.RMBtoNAN(), remaining)
// }
this.remainingAmount.rmbAmount = remaining
} else if (this.showCurrencyId === 3) { // 奈拉
this.verificationData.writtenOff = naira
this.verificationData.WriteOffProportion = NP.times(NP.divide(naira, this.form.receivableTotalAmount), 100)
const remaining = NP.minus(this.form.receivableTotalAmount, naira)
// this.remainingAmount.rmbAmount = remaining
// } else if (this.showCurrencyId === 3) { // 奈拉
// this.verificationData.writtenOff = naira
// this.verificationData.WriteOffProportion = NP.times(NP.divide(naira, this.form.receivableTotalAmount), 100)
// const remaining = NP.minus(this.form.receivableTotalAmount, naira)
// this.remainingAmount = {
// usAmount: NP.times(this.NANtoUS(), remaining),
// rmbAmount: NP.times(this.NANtoRMB(), remaining),
// nairaAmount: remaining
// }
this.remainingAmount.nairaAmount = remaining
}
// this.remainingAmount.nairaAmount = remaining
// }
},
accountChange(val){
var data = this.bankData.find(item=>item.id==val)
......@@ -709,12 +759,13 @@ export default {
if(val === this.showCurrencyId) {
rate = 1
} else {
if (this.showCurrencyId === 1 && val === 3) rate = this.RMBtoUS()
else if (this.showCurrencyId === 1 && val === 2) rate = this.NANtoUS()
else if (this.showCurrencyId === 3 && val === 1) rate = this.UStoRMB()
else if (this.showCurrencyId === 3 && val === 2) rate = this.NANtoRMB()
else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoNAN()
else if (this.showCurrencyId === 2 && val === 3) rate = this.RMBtoNAN()
// if (this.showCurrencyId === 1 && val === 3) rate = this.RMBtoUS()
// else if (this.showCurrencyId === 1 && val === 2) rate = this.NANtoUS()
// else if (this.showCurrencyId === 3 && val === 1) rate = this.UStoRMB()
// else if (this.showCurrencyId === 3 && val === 2) rate = this.NANtoRMB()
// else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoNAN()
// else if (this.showCurrencyId === 2 && val === 3) rate = this.RMBtoNAN()
rate = NP.divide(this.currencyList.find(v => v.id === val).huilv, this.currencyList.find(v => v.id === this.showCurrencyId).huilv).toFixed(6)
}
this.$set(this.addForm, 'rate', rate)
},
......@@ -727,7 +778,7 @@ export default {
rate:parseFloat(v.rate).toFixed(6),
attr: v.attr ? v.attr.split(',').map(t => ({ name: t.slice(t.lastIndexOf('/') + 1), url: t })) : []
}))
this.calculation()
// this.calculation()
})
},
saveFrom() {
......@@ -873,7 +924,7 @@ export default {
}
})
console.log('collom',collom)
if(recepted.length>collom.length){
// if(recepted.length>collom.length){
recepted.forEach((amount,currency)=>{
if(amount){
if(collom[currency]){
......@@ -884,17 +935,20 @@ export default {
}
})
}else{
// }else{
collom.forEach((amount,currency)=>{
if(amount){
if(!this.surplusData[currency]){
if(recepted[currency]){
if((amount-recepted[currency])!=0) this.surplusData[currency] = +parseFloat((amount-recepted[currency]).toPrecision(12))
}else{
this.surplusData[currency] = amount
}
}
}
})
}
// }
console.log(this.surplusData)
this.addForm = {}
this.openAddDialog = true
......
......@@ -216,14 +216,14 @@
</el-table-column>
<el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<template slot-scope="scope">
<span>{{ scope.row.unitPrice }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span>
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column
......@@ -255,6 +255,7 @@ import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector";
import { getTradeCityList } from "@/api/ecw/region";
import { getReceivableList } from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
export default {
name: "Receivable",
......@@ -280,10 +281,16 @@ export default {
rows: 20,
},
tradeCityList: [],
params: {
page: 1,
rows: 20,
},
currencyList:[]
};
},
created() {
let that = this;
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
userList("salesman").then((res) => (that.creatorData = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getList();
......@@ -297,6 +304,11 @@ export default {
},
},
methods: {
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -184,6 +184,7 @@
size="mini"
type="text"
@click="verificationCancelClick(scope.row)"
v-hasPermi="['ecw:verification:update']"
>{{ $t('反核销') }}</el-button
>
<el-button
......@@ -200,6 +201,7 @@
size="mini"
type="text"
@click="toprint(scope.row.id)"
v-hasPermi="['ecw:verification:create']"
>{{ $t('打印') }}</el-button
>
<el-button
......
......@@ -9,7 +9,7 @@
<el-button size="mini" type="primary" @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button>
<el-button type="primary" v-if="[1,3,7].indexOf(list.status) > -1" size="mini" @click="handleAdd">{{$t('跟进')}}</el-button>
<el-button type="primary" v-if="[3,7].indexOf(list.status) > -1" size="mini" @click="toResult">{{$t('结果')}}</el-button>
<el-button size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click="$router.push('/offer/special/' + offerId)">{{$t('特价')}}</el-button>
<el-button size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click.native="$router.push('/offer/special?offerId=' + offerId)" >{{$t('特价')}}</el-button>
<el-button type="danger" size="mini" @click="handleDelete">{{$t('删除')}}</el-button>
</div>
</div>
......
......@@ -356,7 +356,7 @@
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
-{{row.reduceAmount}}
-{{row.reduceTotalAmount}}
{{currencyMap[row.reduceCurrencyId]}}
</template>
</el-table-column>
......@@ -678,7 +678,7 @@ export default {
titleZh: it.titleZh,
titleEn: it.titleEn,
endTime: it.endTime,
reduceAmount: it.reduceAmount,
reduceTotalAmount: it.reduceTotalAmount,
reduceCurrencyId: it.reduceCurrencyId
})
}
......@@ -736,7 +736,7 @@ export default {
}
let coupon = this.couponList.find(coupon => coupon.reduceCurrencyId == item.currencyId)
if(coupon){
it.amount = it.amount.minus(coupon.reduceAmount)
it.amount = it.amount.minus(coupon.reduceTotalAmount)
}
if(this.form.otherFee && this.form.otherFeeCurrencyId == item.currencyId){
it.amount = it.amount.plus(this.form.otherFee)
......
......@@ -7,14 +7,14 @@
<dict-selector defaultable :type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME" v-model="dateFilterType" class="w-100 mr-10" />
<el-date-picker v-model="dateFilter" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss" @change="handleQuery"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('始发')" prop="startWarehouseId">
<el-form-item :label="$t('始发')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发地')" clearable @change="handleQuery">
<el-option v-for="item in expoerCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in exportWarehouseList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的')" prop="destWarehouseId">
<el-form-item :label="$t('目的')" prop="destWarehouseId">
<el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的地')" clearable @change="handleQuery">
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in importWarehouseList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId">
......@@ -157,16 +157,16 @@ import Selector from '@/components/Selector'
import ProductSelector from '@/components/ProductSelector'
import { getProductAttrList } from '@/api/ecw/productAttr'
import CustomerSelector from '@/components/CustomerSelector'
import { getTradeCityList } from '@/api/ecw/region'
/* import { getTradeCityList } from '@/api/ecw/region' */
import Transfer from '@/views/ecw/order/components/Transfer'
import Release from './components/Release'
import CargoControlEdit from './components/CargoControlEdit'
import { getCargoControlOrderPage, batchReview, orderReview, getPickRleaseInfo } from "@/api/ecw/orderCargoControl"
import TransferCargo from '@/views/ecw/order/components/TransferCargo'
import Fallback from './components/Fallback'
import {getWarehouseList} from '@/api/ecw/warehouse'
export default {
name: "OrderCargonControl",
name: "EcwOrderCargonControl",
components: {
CustomerSelector, ProductSelector, Selector, Transfer, Release,CargoControlEdit, TransferCargo, Fallback
},
......@@ -196,6 +196,7 @@ export default {
rows: 10
},
tradeCityList: [],
warehouseList: [],
productAttrList: [], // 商品属性
molecule: '', //重货比分子
denominator: '', //重货比分母
......@@ -215,6 +216,12 @@ export default {
importCityList() {
return this.tradeCityList.filter(item => item.type == 1)
},
exportWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
},
combinedQueryParams(){
let timeParams = {}
if(this.dateFilterType && this.dateFilter){
......@@ -224,10 +231,14 @@ export default {
return Object.assign({}, this.queryParams, timeParams)
}
},
activated(){
this.handleQuery()
},
created() {
this.getList();
getProductAttrList().then(res => this.productAttrList = res.data)
getTradeCityList().then(res => this.tradeCityList = res.data)
// getTradeCityList().then(res => this.tradeCityList = res.data)
getWarehouseList().then(res => this.warehouseList = res.data)
},
methods: {
/** 查询列表 */
......
......@@ -6,7 +6,7 @@
<el-descriptions-item :label="$t('运输方式')">
<dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
</el-descriptions-item>
<el-descriptions-item :label="$t('出货方式')">
<el-descriptions-item :label="$t('出货渠道')">
{{channel ? channel.nameZh : '/'}}
</el-descriptions-item>
<el-descriptions-item :label="$t('订单状态')">
......
......@@ -49,6 +49,7 @@ export default {
return deletePickup({id})
}).then(res => {
this.$message.success('操作成功')
this.$emit('delete', id)
})
},
closeDialog(){
......
......@@ -14,7 +14,10 @@
<el-form-item v-for="(item,index) in this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS)" v-if="advanceType.indexOf(item.value) > -1" :key="item.value" :label="item.label + '预计金额'">
<el-input style="width: 300px;" v-model="specialNeedsList[index].transFee">
<div style="width: 100px;" slot="append" >
<dict-selector v-model="specialNeedsList[index].transCurrency" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" ></dict-selector>
<!-- <dict-selector v-model="specialNeedsList[index].transCurrency" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" ></dict-selector> -->
<el-select v-model="specialNeedsList[index].transCurrency">
<el-option v-for="item in JSON.parse(currency)" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
</div>
</el-input>
<div style="display: inline-block;margin-left: 20px;">
......@@ -35,6 +38,7 @@
<script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {specialNeedCreate,getSpecialListByOrderId} from "@/api/ecw/order";
export default {
name: "specialNeeds",
props:{
......@@ -43,6 +47,7 @@ export default {
},
orderNo:[String,Number],
show:Boolean,
currency:String
},
computed:{
......@@ -56,8 +61,10 @@ export default {
specialNeedsList:[],
todoDetail:'',
echoList:[],
}
},
methods:{
submit(){
this.specialNeedsList.forEach(i => {
......
......@@ -260,7 +260,7 @@ export default {
getOrder(res.data.orderIds).then(r =>{
this.FeeDetails = r.data
this.FeeDetails.details = JSON.parse(res.data.details)
const orderItem = this.FeeDetails.orderItemVOList.find(e => e.brand === this.FeeDetails.details.brand)
const orderItem = this.FeeDetails.orderItemVOList.find(e => e.orderItemId === this.FeeDetails.details.orderItemId)
if (orderItem){
this.prodName = orderItem.prodTitleZh + '(' + orderItem.prodTitleEn + ')'
}
......
......@@ -45,7 +45,7 @@
<el-descriptions border :title="$t('物流信息')" :column="2">
<el-descriptions-item :label="$t('始发仓')">{{order.logisticsInfoDto.startTitleZh}}</el-descriptions-item>
<el-descriptions-item :label="$t('目的仓')">{{order.logisticsInfoDto.destTitleZh}}</el-descriptions-item>
<el-descriptions-item :label="$t('地址')" :span="2">{{order.logisticsInfoDto.startAddressZh}}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('地址')" :span="2">{{order.logisticsInfoDto.startAddressZh}}</el-descriptions-item> -->
<el-descriptions-item :label="$t('运输方式')" :span="2">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
</el-descriptions-item>
......@@ -145,7 +145,11 @@
{{order.inWarehouseState > 1 && row.warehouseInInfoVO ? row.warehouseInInfoVO.weight : row.weight}}
</template>
</el-table-column>
<el-table-column prop="warehouseInInfoVO.quantityAll" :label="$t('数量') + '(个)'" width="90px"/>
<el-table-column prop="warehouseInInfoVO.quantityAll" :label="$t('数量') + '(个)'" width="90px">
<template slot-scope="{row}">
{{(order.inWarehouseState > 1 && row.warehouseInInfoVO) ? row.warehouseInInfoVO.quantityAll : row.quantity}}
</template>
</el-table-column>
<el-table-column prop="" :label="$t('费用类型')">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.isPayAdvance" />
......
......@@ -84,9 +84,7 @@
<el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')"></el-input>
</el-form-item>
<select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px" :disabled="inWarehouse">
<template v-for="item in routerList">
<option :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
</template>
<option v-for="item in routerList" :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
</select>
</div>
</el-card>
......@@ -96,7 +94,7 @@
<el-button type="primary" size="mini" @click="addProduct(null)" :disabled="!canAddProduct">{{$t('添加货物')}}</el-button>
<el-button type="primary" size="mini" @click="showBatchImportDialog=true" :disabled="!canAddProduct">{{$t('批量添加货物')}}</el-button>
</div>
<el-table :data="form.orderItemVOList" border class="product-list">
<el-table :data="form.orderItemVOList" border class="product-list" v-if="!initing">
<el-table-column :label="$t('序号')" width="60px" fixed>
<template slot-scope="scope">
{{scope.$index + 1}}
......@@ -115,6 +113,7 @@
class="mb-0 mr-0"
>
<product-selector
@hook:mounted="onTableMounted"
v-model="scope.row.prodId"
@change="onProductChange(scope.row, $event)"
:disabled="!canAddProduct || !productEditable"
......@@ -136,14 +135,9 @@
:disabled="!canAddProduct || !productEditable" />
</template>
</el-table-column>
<!-- <el-table-column label="商品类型" width="160px">
<template slot-scope="{row}">
<selector disabled v-model="row.goodsType" :options="productAttrList" label-field="attrName" value-field="id"></selector>
</template>
</el-table-column> -->
<el-table-column :label="$t('品牌')" width="100px">
<template slot="header" slot-scope="scope">
<template slot="header">
{{$t('品牌')}} <span class="red">*</span>
</template>
<template slot-scope="scope">
......@@ -159,11 +153,11 @@
</template>
</el-table-column>
<el-table-column :label="$t('件数')" width="90px">
<template slot="header" slot-scope="scope">
<template slot="header">
{{$t('件数')}} <span class="red">*</span>
</template>
<template slot-scope="{row}">
<el-input v-model.number="row.num" :disabled="!canAddProduct || !productEditable" />
<el-input v-model.number="row.num" @keyup.native="checkPositiveInterge(row, 'num')" :disabled="!canAddProduct || !productEditable" />
</template>
</el-table-column>
<el-table-column :label="$t('包装单位')" width="100px">
......@@ -176,17 +170,33 @@
</el-table-column>
<el-table-column :label="$t('数量') + '(个)'" width="120px">
<template slot-scope="{row}">
<el-input v-model="row.quantity" type="number" @keyup.native="checkQuantity(row)" :disabled="!canAddProduct || !productEditable" />
<el-input v-model="row.quantity" @keyup.native="checkPositiveInterge(row, 'quantity')" :disabled="!canAddProduct || !productEditable" />
</template>
</el-table-column>
<el-table-column :label="$t('总体积') + '(m³)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.volume" :disabled="!canAddProduct || !productEditable" />
<el-table-column :label="$t('总体积') + '(m³)'" width="120px">
<template slot-scope="scope">
<el-form-item label=""
:prop="`orderItemVOList.${scope.$index}.volume`"
:rules="[
{ validator: validatorPositiveNumber, message: $t('体积错误'), trigger: 'blur'}
]"
class="mb-0 mr-0"
>
<el-input v-model="scope.row.volume" :disabled="!canAddProduct || !productEditable" />
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('总重量') + '(kg)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.weight" :disabled="!canAddProduct || !productEditable" />
<el-table-column :label="$t('总重量') + '(kg)'" width="120px">
<template slot-scope="scope">
<el-form-item label=""
:prop="`orderItemVOList.${scope.$index}.weight`"
:rules="[
{ validator: validatorPositiveNumber, message: $t('重量错误'), trigger: 'blur'}
]"
class="mb-0 mr-0"
>
<el-input v-model="scope.row.weight" :disabled="!canAddProduct || !productEditable" />
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('总货值') + '(RMB)'" width="100px">
......@@ -196,12 +206,13 @@
<template slot-scope="scope">
<el-form-item label=""
:prop="`orderItemVOList.${scope.$index}.worth`"
:rules="{
required: true, message: $t('货值不能为空'), trigger: 'blur'
}"
:rules="[
{ required: true, message: $t('货值不能为空'), trigger: 'blur'},
{ type: 'number', min: 0, message: $t('货值错误'), trigger: 'blur'}
]"
class="mb-0 mr-0"
>
<el-input v-model="scope.row.worth" :disabled="!canAddProduct" @input="calculationPrice" type="number" />
<el-input v-model.number="scope.row.worth" :disabled="!canAddProduct" @input="calculationPrice" type="number" />
</el-form-item>
</template>
</el-table-column>
......@@ -352,8 +363,9 @@
:disabled="false"
></area-selector>
</el-form-item>
<br/>
<el-form-item :label="$t('收货详细地址')" prop="consigneeAddress">
<el-input v-model="form.consigneeAddress" :disabled="false"></el-input>
<el-input v-model="form.consigneeAddress" :disabled="false" class="w-300"></el-input>
</el-form-item>
</div>
<div>
......@@ -506,9 +518,11 @@ import {calculationPrice} from '@/api/ecw/product'
import SupplierSelector from '@/components/SupplierSelector'
import Decimal from 'decimal.js'
import WorkFlow from '@/components/WorkFlow'
import { getCustomer } from "@/api/ecw/customer";
// 缓存默认的表单数据
let defaultFormData = null
window.Decimal = Decimal
export default {
name: "EcwOrderEdit",
......@@ -516,7 +530,16 @@ export default {
ProductSelector, Selector, CustomerContactSelector, AreaSelector, FileUpload, AreaCodeSelector, ChooseContactDialog, QuickCreateCustomer, SupplierSelector, WorkFlow
},
data() {
let validatorPositiveNumber = (rule, value, callback) => {
if(!value || value == '')return callback();
if (!value) return callback(new Error('请输入数字'))
if (!Number(value)) return callback(new Error('请输入有效数字'))
let reg = /((^[1-9]\d*)|^0)(\.\d*){0,1}$/;
if (!reg.test(value)) return callback(new Error('请输入有效数字'));
callback();
}
return {
validatorPositiveNumber,
customDraweeList: [],
// draweeList: [],
// 遮罩层
......@@ -589,6 +612,7 @@ export default {
quickCreateType: null, // 快速新建客户类型,1发货人,2收货人
showWorkFlow: false, // 是否显示工作流表单
calculating: false, // 是否正在计算费用,防止频繁重新请求
initing: true, // 初始化中
};
},
computed:{
......@@ -725,7 +749,7 @@ export default {
'form.objectiveId'(){
this.getOpenedRouterList()
},
'form.transportId'(transportId){
'form.transportId'(transportId, oldTransportId){
// 海运拼柜给表单默认值
if(this.form.transportId == 4){
this.$nextTick(() => {
......@@ -738,7 +762,8 @@ export default {
})
}
// 更换运输方式之后,之前选择的路线会失效,需要重新选择
if(transportId != this.selectedRouter?.transportType){
if(oldTransportId && oldTransportId != transportId && transportId != this.selectedRouter?.transportType){
console.log('重置路线',oldTransportId, transportId, this.selectedRouter?.transportType)
this.$set(this.form, 'lineId', undefined)
}
......@@ -769,9 +794,20 @@ export default {
}else if(!this.form.externalWarehouseDtoList.length){
this.$set(this.form, 'externalWarehouseDtoList', [{}])
}
},
// 选择送货上门需要查询并填充默认地址
'form.harvestMethod'(harvestMethod){
if(harvestMethod == 2 && !this.form.address && this.form.consigneeId){
getCustomer(this.form.consigneeId).then(res => {
if(res.data.address){
this.$set(this.form, 'consigneeAddress', res.data.address)
}
})
}
},
/* 'form.orderItemVOList'(){
console.log('form.orderItemVOList', this.form.orderItemVOList.length, this.form.orderItemVOList)
}, */
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val){
if(!val) return
......@@ -808,13 +844,20 @@ export default {
value: 2 // 1 发货人,2收货人,默认收货人,可修改
})
})
this.$nextTick(() => {
this.initing = false
})
},
methods: {
onTableMounted(e){
// console.warn('onTableMounted', e)
},
getOrder(){
getUpdateInfo(this.$route.query.id).then(res => {
this.form = {...res.data}
this.form = Object.assign({}, res.data, {orderItemVOList: []})
this.form.orderItemVOList = [];
/* this.form.orderItemVOList = []; */
this.form.type = this.form.type ? this.form.type.split(',').filter(item => item != '') : []
this.form.packageTypeArr = this.form.packageType ? this.form.packageType.split(',').filter(item => item != '') : []
......@@ -862,7 +905,10 @@ export default {
})
})
}
this.initing = false
})
}).catch(() => {
this.initing = false
})
},
onContactChoose(contact){
......@@ -924,24 +970,11 @@ export default {
this.$set(row, 'link', value)
})
},
checkQuantity(row){
row.quantity = row.quantity.replace(/[^\d]/g, '')
// 检查正整数
checkPositiveInterge(row, field){
console.log('checkPositiveInterge', field, row[field])
row[field] = row[field].replace(/[^\d]/g, '')
},
/* onFileChoosed(e){
window.choosed = e
console.log('onFileChoosed', e)
const reader = new FileReader();
reader.readAsBinaryString(e.target.files[0]);
reader.onload = function(e) {
const data = e.target.result;
const zzexcel = xlsx.read(data, {
type: 'binary'
})
window.zzexcel = zzexcel
window.tableJson = xlsx.utils.sheet_to_json(zzexcel.Sheets[zzexcel.SheetNames[0]])
}
}, */
onProductChange(row, product){
console.log(product)
// 如果是清除商品
......@@ -1090,7 +1123,8 @@ export default {
lineId: this.form.lineId,
transportId: this.form.transportId,
channelId: [3,4].indexOf(this.form.transportId) > -1 ? this.form.channelId : undefined,
prodConditionParamList: this.getProductListWithDefaultValue()
prodConditionParamList: this.getProductListWithDefaultValue(),
orderType: this.form.orderType
}).then(res => {
this.$set(this, 'fee', res.data.costDto)
this.form.orderItemVOList.map((item, index) => {
......@@ -1109,6 +1143,7 @@ export default {
if(!tmp.weight)tmp.weight = 1
if(!tmp.quantity)tmp.quantity = 1
if(!tmp.num)tmp.num = 1
tmp.orderType = item.orderItemType
arr.push(tmp)
})
return arr
......
......@@ -12,7 +12,17 @@
<span style="margin: 0 8px;">{{$t('')}}</span>
<el-date-picker clearable v-model="queryParams.endCreateTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" :placeholder="$t('请选择结束日期')" />
</el-form-item>
<el-form-item :label="$t('始发地')+':'">
<el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的仓')" clearable>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item :label="$t('始发地')+':'">
<el-select v-model="queryParams.originId" :placeholder="$t('请选择始发地')" clearable>
<el-option v-for="item in expoerCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
......@@ -21,7 +31,7 @@
<el-select v-model="queryParams.destinationId" :placeholder="$t('请选择目的地')" clearable>
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id" ></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item :label="$t('运输方式')+':'" >
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :clearable="true" v-model="queryParams.transportId" />
</el-form-item>
......@@ -155,9 +165,10 @@ import {DICT_TYPE} from '@/utils/dict'
import {listServiceUser} from "@/api/system/user"
import CustomerSelector from '@/components/CustomerSelector'
import ProductSelector from '@/components/ProductSelector'
import {getWarehouseList} from '@/api/ecw/warehouse'
export default {
name: "Exception",
name: "EcwOrderException",
components: {
CustomerSelector,ProductSelector
},
......@@ -179,14 +190,20 @@ export default {
rows: 10
},
tradeCityList:[],
warehouseList:[],
};
},
activated(){
this.handleQuery()
},
created() {
this.getList();
getTradeCityList().then(res => this.tradeCityList = res.data)
// getTradeCityList().then(res => this.tradeCityList = res.data)
listServiceUser().then(r => {
this.creatorData = r.data
})
getWarehouseList().then(res => this.warehouseList = res.data)
// userList('salesman').then(res =>this.creatorData = res.data)
},
computed:{
......@@ -196,7 +213,13 @@ export default {
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
},
exportWarehouseList(){
/* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
},
},
methods: {
/** 查询列表 */
......
......@@ -28,7 +28,10 @@
</el-table-column>
<el-table-column :label="$t('货币类型')">
<template v-slot:default = 'scope'>
<dict-selector :disabled="isModify[forbidden(scope.row)]" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" v-model="scope.row.applicationFeeCurrency" />
<el-select :disabled="isModify[forbidden(scope.row)]" v-model="scope.row.applicationFeeCurrency">
<el-option v-for="item in JSON.parse(currencys)" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<!-- <dict-selector :disabled="isModify[forbidden(scope.row)]" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" v-model="scope.row.applicationFeeCurrency" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('付款类型')">
......@@ -91,7 +94,8 @@ export default {
dialogVisible:{
type:Boolean,
default:false,
}
},
currencys:String
},
data(){
return {
......
......@@ -185,16 +185,13 @@
<el-dropdown-menu slot="dropdown">
<!-- 编辑 -->
<template v-if="
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
exclude(scope.row.status, [20,21]) &&
exclude(scope.row.shipmentState, [320,322,323]) &&
exclude(scope.row.inWarehouseState, [ 212, 218, 213, 214, 215])
( scope.row.status < 12 || (scope.row.status == 12 && scope.row.shipmentState == 314) ) && !scope.row.abnormalState
">
<el-dropdown-item @click.native="handleUpdate(scope.row)" v-hasPermi="['ecw:order:update']" >{{$t('编辑')}}</el-dropdown-item>
</template>
<!-- 删除 -->
<template v-if="include(scope.row.status, [0,2])">
<template v-if="include(scope.row.status, [0,2, 88])">
<el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']" >{{$t('删除')}}</el-dropdown-item>
</template>
......@@ -208,16 +205,14 @@
<!-- 费用申请 -->
<template v-if="
exclude(scope.row.status, [0]) &&
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
exclude(scope.row.shipmentState, [320,322,323])
exclude(scope.row.status, [0, 88]) && !scope.row.abnormalState
">
<el-dropdown-item @click.native="feeApplicationBol = true; orderId = scope.row.orderId" >{{$t('费用申请')}}</el-dropdown-item>
</template>
<!-- 特需,互斥,关联 -->
<template v-if="
exclude(scope.row.status, [0]) &&
include(scope.row.status, [2,3,5,8,9,10]) &&
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
exclude(scope.row.inWarehouseState, [204])
">
......@@ -229,18 +224,15 @@
<!-- 特价 -->
<template v-if="
exclude(scope.row.status, [0]) &&
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
exclude(scope.row.shipmentState, [320,322,323])
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14])
">
<el-dropdown-item @click.native="$router.push('/order/special/' + scope.row.orderId)" v-hasPermi="['ecw:order:update']" >{{$t('特价')}}</el-dropdown-item>
</template>
<!-- 确认提货 -->
<template v-if="
exclude(scope.row.status, [0,2]) &&
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
exclude(scope.row.shipmentState, [320,322,323]) &&
exclude(scope.row.inWarehouseState, [201])
scope.row.status >= 5 &&
!scope.row.abnormalState
">
<el-dropdown-item @click.native="$router.push(`/order/release?orderId=${scope.row.orderId}`)" >{{$t('确认提货')}}</el-dropdown-item>
</template>
......@@ -257,17 +249,17 @@
</template>
<!-- 合单日志,提货日志 -->
<template v-if="scope.row.status > 2">
<template v-if="scope.row.status >= 5 && scope.row.status < 12 && !scope.row.abnormalState || (scope.row.status == 12 && scope.row.shipmentState == 314) ">
<el-dropdown-item @click.native="showMergedLogOrderNo=scope.row.orderNo" >{{$t('合单日志')}}</el-dropdown-item>
<el-dropdown-item @click.native="showPickupLogOrderNo=scope.row.orderNo" >{{$t('提货日志')}}</el-dropdown-item>
</template>
</el-dropdown-menu>
</el-dropdown>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider>
<!--仓库相关的-->
<el-dropdown>
<el-dropdown v-if="scope.row.status != 0">
<el-button type="text">{{$t('仓库')}}</el-button>
<el-dropdown-menu slot="dropdown">
<!-- 入仓操作 -->
......@@ -333,10 +325,10 @@
</el-dropdown-menu>
</el-dropdown>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider>
<!--打印相关的-->
<el-dropdown>
<el-dropdown v-if="scope.row.status != 0">
<el-button type="text">{{$t('打印')}}</el-button>
<el-dropdown-menu slot="dropdown">
<!-- 打印标签 -->
......@@ -370,16 +362,16 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
@pagination="getList" />
<special-needs :orderNo="orderNo" :show.sync="isShow" :order-id="orderId" @determine="getList" ></special-needs>
<special-needs :orderNo="orderNo" :show.sync="isShow" :currency="JSON.stringify(currencyList)" :order-id="orderId" @determine="getList" ></special-needs>
<print-tag v-if="printTagOrderId !== null" :order-id="printTagOrderId" @close="printTagOrderId=null" />
<print-warehouse-receipt v-if="printWarehouseReceiptOrderId !== null" :order-id="printWarehouseReceiptOrderId" @close="printWarehouseReceiptOrderId=null" />
<print-lading-bill v-if="printLadingBillOrderId !== null" :order-id="printLadingBillOrderId" @close="printLadingBillOrderId=null" />
<batch-pickup v-if="showBatchPickup" @close="onBatchClose" @success="onBatchClose"/>
<withdrawal v-if="show" :dialog-visible="show" :orderId="orderId" ></withdrawal>
<batch-single-application :order-list="orderId" :dialog-visible.sync="warehouseBol"></batch-single-application>
<fee-application :order-id="orderId" :dialog-visible.sync="feeApplicationBol"></fee-application>
<fee-application :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
<merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo=null" />
<pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" />
<pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" @delete="getList" />
</div>
</template>
......@@ -414,8 +406,9 @@ import FeeApplication from "@/views/ecw/order/feeApplication";
import MergeLog from '@/views/ecw/order/components/MergeLog'
import PickupLog from './components/PickupLog'
import {getWarehouseList} from '@/api/ecw/warehouse'
import { getCurrencyPage } from "@/api/ecw/currency";
export default {
name: "Order",
name: "EcwOrderIndex",
components: {
UserSelector,
FeeApplication,
......@@ -477,7 +470,12 @@ export default {
multipleSelection:[],
transportId: null, // 指定运输方式
orderNo:''
orderNo:'',
params: {
page: 1,
rows: 20,
},
currencyList:[]
};
},
computed: {
......@@ -520,12 +518,17 @@ export default {
}
}
},
activated(){
this.handleQuery()
},
created() {
this.getTransportFromRoute()
this.getList();
getProductAttrList().then(res => this.productAttrList = res.data)
// getTradeCityList().then(res => this.tradeCityList = res.data)
getWarehouseList().then(res => this.warehouseList = res.data)
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
},
methods: {
// 提取路径中的运输方式
......
......@@ -4,6 +4,7 @@
<script>
import Index from './index'
export default {
name: 'EcwOrderMine',
components: {Index}
}
</script>
\ No newline at end of file
......@@ -272,8 +272,8 @@
<!-- <el-select v-model="handlerParams.currency" clearable>
<el-option v-for="dict in getDictDatas('shipping_price_unit') "
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> -->
<dict-tag type="shipping_price_unit" v-model="handlerParams.currency" class="w-100 ml-10" />
</el-select> -->{{getCurrencyLabel(handlerParams.currency)}}
<!-- <dict-tag type="shipping_price_unit" v-model="handlerParams.currency" class="w-100 ml-10" /> -->
</el-form-item>
</el-row>
......@@ -281,8 +281,8 @@
<el-form-item :label="$t('送货费用')+':'" size="medium">
<el-input style="width: 100px;" type="text" v-model="handlerParams.amount" />
<el-select v-model="handlerParams.currency" style="width: 100px;margin-left: 10px;" clearable>
<el-option v-for="dict in getDictDatas('shipping_price_unit') "
:key="dict.value" :label="dict.label" :value="dict.value"/>
<el-option v-for="dict in currencyList "
:key="dict.id" :label="dict.titleZh" :value="dict.id"/>
</el-select>
</el-form-item>
</el-row>
......@@ -313,8 +313,8 @@
<el-form-item :label="$t('赔付金额')+':'" size="medium" required v-if="handlerParams.orderExceptionStatus==2">
<el-input style="width: 100px;" type="text" v-model="handlerParams.amount" />
<el-select v-model="handlerParams.currency" style="width: 100px;margin-left: 10px;" clearable>
<el-option v-for="dict in getDictDatas('shipping_price_unit') "
:key="dict.value" :label="dict.label" :value="dict.value"/>
<el-option v-for="dict in currencyList "
:key="dict.id" :label="dict.titleZh" :value="dict.id"/>
</el-select>
</el-form-item>
</el-row>
......@@ -430,6 +430,11 @@
},
methods: {
/** 查询列表 */
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return label[0].titleZh
return ''
},
getList() {
let that = this
that.loading = true;
......
......@@ -276,7 +276,7 @@ export default {
},
submitForm(){
let that = this
if(!that.orderNos){
if(!that.orderNos||that.orderNos.length==0){
that.$message.error(this.$t("请选择待合单的订单"));
return
}
......
......@@ -95,7 +95,7 @@
<template v-slot="{row}">
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showDiscountItem=row">{{$t('优惠申请')}}</el-button>
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showCommissionItem=row">{{$t('佣金规则')}}</el-button>
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showAllowanceItem=row">{{$t('管理折扣')}}</el-button>
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:discount']" @click="showAllowanceItem=row">{{$t('管理折扣')}}</el-button>
</template>
</el-table-column>
......
......@@ -96,7 +96,7 @@
</el-row>
<el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('品牌')}}
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" />
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</span>
<span style="margin-left: 10px;">{{$t('箱数')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}</span>
......@@ -189,23 +189,20 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body>
<el-form ref="formSplit" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-form-item :label="$t('运输方式')+':'">
<dict-selector :clearable="true" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" formatter="number"/>
<el-form-item :label="$t('运输方式')">
<dict-selector :clearable="true" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" @change="changeTransport" v-model="form.transportId" />
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('目的仓库')+':'" >
<el-select v-model="form.destWarehouseId" :placeholder="$t('请选择目的仓库')" clearable>
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id" ></el-option>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'">
<el-select v-model="form.channelId" :placeholder="$t('请选择出货渠道')" :clearable="true">
<el-option :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-for="item in channelData" :key="item.channelId" :label="$l(item, 'name')" :value="item.channelId"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" >
<el-select v-model="form.channelId" :placeholder="$t('请选择出货渠道')" clearable>
<el-option :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-for="item in channelData" :key="item.channelId" :label="item.nameZh" :value="item.channelId"/>
<el-form-item :label="$t('目的仓库')" >
<el-select v-model="form.destWarehouseId" @change="changeDeatWarehouseId" :placeholder="$t('请选择目的仓库')" :clearable="true">
<el-option v-for="items in importCityList" :label="$l(items, 'title')" :value="items.id" :key="items.id" ></el-option>
</el-select>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -373,6 +370,16 @@ export default {
}
return data
},
changeTransport(e){
this.$set(this.form,'transportId',e)
console.log(this.form.transportId)
this.$forceUpdate()
},
changeDeatWarehouseId(e){
this.$forceUpdate()
this.$set(this.form,'destWarehouseId',e)
console.log(this.form.destWarehouseId)
},
getOrder(){
this.loading = true;
getOrder(this.queryParams.orderId).then(response => {
......
......@@ -57,7 +57,7 @@
</el-descriptions-item>
</el-descriptions>
<el-form-item label="材质" style="margin-top: 20px">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material"></dict-selector>
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material" clearable></dict-selector>
</el-form-item>
<el-form-item label="入仓时间" v-if="!edit">
<el-date-picker v-model="form.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
......@@ -82,11 +82,14 @@
<el-form-item :rules="tableFormRules.cartonsNum" :prop="$index + '.cartonsNum'">
<span v-if="tableData[$index].id && !edit">
{{ tableData[$index].cartonsNum }}
{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGING_TYPE, tableData[$index].unit) }}
{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, tableData[$index].specificationType) }}
</span>
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder="">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGING_TYPE, tableData[$index].unit) }}</span>
<template v-else>
<el-input v-model="tableData[$index].cartonsNum" placeholder="" @blur="handleVolume($index)">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, tableData[$index].specificationType) }}</span>
</el-input>
<dict-selector :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="tableData[$index].specificationType" @change="handleVolume($index)"></dict-selector>
</template>
</el-form-item>
</template>
</el-table-column>
......@@ -362,7 +365,7 @@
<script>
import dictSelector from "@/components/DictSelector"
import {DICT_TYPE, getDictDataLabel} from "@/utils/dict"
import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"
import {getWarehouseLastUpdateApprovalInfo, orderWarehouseIn, orderWarehouseInUpdateApply} from '@/api/ecw/order'
import { getFeeTypeByOrderProduct, getProductBrankPage } from '@/api/ecw/productBrank'
import WorkFlow from "@/components/WorkFlow"
......@@ -419,6 +422,7 @@ export default {
return {
DICT_TYPE,
getDictDataLabel,
getDictDatas,
opened: false,
brandList: [],
formRules: {
......@@ -560,15 +564,17 @@ export default {
})
},
handleVolume(index, val){
const {boxGauge1, boxGauge2, boxGauge3} = (val === 1 ? this.tableData1 : this.tableData)[index]
setTimeout(() => {
const {boxGauge1, boxGauge2, boxGauge3, specificationType, cartonsNum} = (val === 1 ? this.tableData1 : this.tableData)[index]
let result = ''
if (boxGauge1 && boxGauge2 && boxGauge3) {
result = ((boxGauge1 * boxGauge2 * boxGauge3) / 1000000)?.toFixed(2) || ''
if (boxGauge1 && boxGauge2 && boxGauge3 && specificationType && cartonsNum) {
result = (((specificationType === 1 || specificationType === '1') ? cartonsNum : 1) * (boxGauge1 * boxGauge2 * boxGauge3) / 1000000)?.toFixed(2) || ''
} else {
result = ''
}
if (result === '0.00') result = '0.01';
(val === 1 ? this.tableData1 : this.tableData)[index].volume = result
}, 0)
},
handleSubmit() {
const orderWarehouseInItemDoList = [
......@@ -624,8 +630,8 @@ export default {
orderItemId: this.warehousing.orderItemId,
orderNo: this.warehousing.orderNo,
num: this.warehousing.num,
volume: this.warehousing.volume?.toFixed(2) || '',
weight: this.warehousing.weight?.toFixed(2) || '',
volume: (+this.warehousing.volume)?.toFixed(2) || '',
weight: (+this.warehousing.weight)?.toFixed(2) || '',
prodId: this.warehousing.prodId,
"orderWarehouseInUpdateItemDoList": this.tableData.map(e => {
return {
......@@ -691,7 +697,8 @@ export default {
"quantityAll": "",
"unit": "1",
"volume": '',
"weight": ''
"weight": '',
specificationType: '1'
})
}
},
......
......@@ -67,9 +67,15 @@
prop="diffType"
v-slot="{row}"
:label="$t('状态')">
<dict-tag v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.diffType" :type="DICT_TYPE.ORDER_WAREHOUSE_IN_STATUS" :value="row.warehouseInInfoVO.diffType" class="red" :class="{green: row.warehouseInInfoVO.diffType === 4}"/>
<span class="red" v-else-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff">{{ row.warehouseInInfoVO.cartonsNumDiff }}{{$t('箱')}}</span>
<span v-else>{{ $t('待入仓') }}</span>
<dict-tag
v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.diffType"
:type="DICT_TYPE.ORDER_WAREHOUSE_IN_STATUS"
:value="row.warehouseInInfoVO.diffType"
class="red"
:class="{green: row.warehouseInInfoVO.diffType === 4}"
/>
<span :class="{red: row.itemStatus === 3}" v-else>{{ row.itemStatus === 3 ? ($t('少了') + row.num + $t('箱')) : $t('待入仓') }}</span>
<span class="red" v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff">{{ row.warehouseInInfoVO.cartonsNumDiff }}{{$t('箱')}}</span>
</el-table-column>
<el-table-column
prop="address"
......
......@@ -436,7 +436,7 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// this.reset();
const id = row.id;
getProduct(id).then(response => {
this.form = {...response.data};
......@@ -446,7 +446,7 @@ export default {
attrArray[index] = parseInt(value);
}
this.$nextTick(() =>{
this.form.attrArray = attrArray
this.$set(this.form, 'attrArray', attrArray)
})
this.open = true;
this.title = this.$t("修改商品");
......
......@@ -19,7 +19,7 @@
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.packaging" />
</el-form-item>
<el-form-item :label="$t('是否预约入仓')" prop="needBook">
<dict-selector formatter="bool" form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.needBook" :formater="Boolean" />
<dict-selector form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.needBook" formatter="number" />
</el-form-item>
<el-form-item :label="$t('每日入仓上限')" prop="dayLimit" v-if="form.needBook">
<el-input placeholder="" v-model="form.dayLimit" class="w-200">
......
......@@ -69,8 +69,8 @@
</div>
<el-form-item :label="$t('预付')" prop="needPay" v-if="$route.query.action == 'batchUpdate'" >
<el-radio-group v-model="form.needPay">
<el-radio :label="1">预付</el-radio>
<el-radio :label="0">均可</el-radio>
<el-radio :label="1">{{$t('预付')}}</el-radio>
<el-radio :label="0">{{$t('均可')}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('单价模式')" prop="priceType">
......@@ -78,13 +78,13 @@
</el-form-item>
<!--阶梯定价-->
<template v-if="form.stepPrice==1" >
<div v-for="(item, index) in priceStepList" :key="index">
<div v-for="(item, index) in form.priceStepList" :key="index">
<div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="index == priceStepList.length - 1">
<el-link type="primary" @click.native="priceStepList.push({})">{{$t('添加区间')}}</el-link>
<template v-if="index == form.priceStepList.length - 1">
<el-link type="primary" @click.native="form.priceStepList.push({})">{{$t('添加区间')}}</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click.native="priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
<el-link type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template>
</div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index + 1})">
......@@ -94,40 +94,45 @@
/
<selector v-model="form.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<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 v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<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 v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<el-form-item
:label="$t('默认全包价')"
v-if="form.priceType == 1"
:prop="`priceStepList.${index}.allPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
/ <selector v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</div>
</template>
<template v-else>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" prop="allPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10 aaa" />
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr10" />
<span class="mr-10">/</span>
<selector v-model="form.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice">
<el-form-item :label="$t('默认运费')" prop="transportPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="form.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" prop="clearancePrice">
<el-form-item :label="$t('默认清关费')" prop="clearancePrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
......@@ -135,23 +140,28 @@
</el-form-item>
</template>
<!--特需-->
<template v-if="form.priceType==1">
<el-form-item
v-for="(special, specialIndex) in this.specialProducts"
v-for="(special, specialIndex) in this.form.specialList"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key="specialIndex + 'transport'">
:key="specialIndex + 'transport'"
:prop="`specialList.${specialIndex}`.allPrice"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="special.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
<template v-else v-for="(special, specialIndex) in this.specialProducts">
<template v-else v-for="(special, specialIndex) in this.form.specialList">
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key="specialIndex + 'transport'">
:key="specialIndex + 'transport'"
:prop="`specialList.${specialIndex}.transportPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
......@@ -159,7 +169,10 @@
</el-form-item>
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key="specialIndex + 'clearance'">
:key="specialIndex + 'clearance'"
:prop="`specialList.${specialIndex}.clearancePrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span>
......@@ -223,11 +236,14 @@ export default {
return {
checkList: [],
selectedRoutes: [], // 勾选的路线渠道
form: {},
form: {
priceStepList: [{},{}], // 阶梯价格
specialList: []
},
needPay: false, // 是否需要预付
stepPrice: false, // 是否阶梯订单
specialProducts: [],
priceStepList: [{},{}], // 阶梯价格
// specialProducts: [],
// priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个
rules: {
transportPrice: [{ required: true, message: this.$t("海运费不能为空"), trigger: "blur" }],
......@@ -277,20 +293,9 @@ export default {
// 特殊需求回显
if (val.specialList) {
val.specialList.forEach(item => {
let index = this.specialProducts.findIndex(special => special.specialDictType == item.specialDictType)
if(index > -1)this.specialProducts[index] = item
let index = this.form.specialList.findIndex(special => special.specialDictType == item.specialDictType)
if(index > -1)this.form.specialList[index] = item
})
// this.specialProducts = val.specialList
/* let keyed = arrryToKeyedObjectBy(val.specialList, 'specialDictType')
this.specialProducts.map((item, index) => {
if (keyed[item.specialDictType]) {
for (let field in item) {
if (keyed[item.specialDictType][field]) {
item[field] = keyed[item.specialDictType][field]
}
}
}
}) */
}
},
'form.priceType'(priceType){
......@@ -300,32 +305,32 @@ export default {
}
},
'form.transportVolumeUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.transportVolumeUnit = val
})
},
'form.clearanceVolumeUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.clearanceVolumeUnit = val
})
},
'form.transportPriceUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.transportPriceUnit = val
})
},
'form.clearancePriceUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.clearancePriceUnit = val
})
},
'form.allPriceUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.allPriceUnit = val
})
},
'form.allVolumeUnit'(val){
this.specialProducts.forEach(item => {
this.form.specialList.forEach(item => {
item.allVolumeUnit = val
})
},
......@@ -333,6 +338,11 @@ export default {
if(val) this.$set(this.form, 'dayLimit', 10000)
else delete this.form.dayLimit
},
'form.stepPrice'(stepPrice){
if(stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
this.$set(this.form, 'priceStepList', [{},{}])
}
},
needPay(val){
this.$set(this.form, 'needPay', val ? 1 : 0)
},
......@@ -362,7 +372,7 @@ export default {
// action=batchUpdate 表示批量修改单个商品的价格(一条或者多条),如果没有ids显示路线选择组件,否则不显示路线组件
// action=update 表示修改单个商品的单条路线价格,需要回显
if(this.$route.query.action == 'update'){
getProductPrice(this.$route.query.id).then(res => {
let res = await getProductPrice(this.$route.query.id)
this.$set(this, 'form', res.data)
if(this.form.needPay){
this.needPay = true
......@@ -374,7 +384,6 @@ export default {
this.form.validateEndDate = parseTime(res.data.validateEndDate)
}
this.lineList = [res.data]
})
}
// action=batchUpdate且ids不为空
......@@ -434,8 +443,11 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
if(!this.form.specialList){
this.$set(this.form, 'specialList', [])
}
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
this.specialProducts.push({
this.form.specialList.push({
"clearancePrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"clearancePriceUnit": null,
"clearanceVolumeUnit": null,
......@@ -447,6 +459,14 @@ export default {
})
},
methods: {
priceValidator(rule, value, callback){
if(!value || value == '') return callback()
value = parseFloat(value)
if(!value || value < 0){
return callback(new Error('价格错误'))
}
callback()
},
setDefaultVolumeUnit(unit){
this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit)
......@@ -477,8 +497,9 @@ export default {
specialList: this.specialProducts,
isAllProduct: 0
})
if(this.form.stepPrice == 1){
data.priceStepList = this.priceStepList
if(this.form.stepPrice != 1){
// data.priceStepList = this.priceStepList
delete data.priceStepList
}
// 修改单条路线
......
......@@ -152,7 +152,7 @@
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
<el-tree class="tree-border" :data="menuOptions" show-checkbox ref="menu" node-key="id"
:check-strictly="form.menuCheckStrictly" empty-text="加载中,请稍后" :props="defaultProps"></el-tree>
:check-strictly="true" empty-text="加载中,请稍后" :props="defaultProps"></el-tree>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -396,7 +396,7 @@ export default {
// 获得角色拥有的菜单集合
listRoleMenus(id).then(response => {
// 设置为严格,避免设置父节点自动选中子节点,解决半选中问题
this.form.menuCheckStrictly = true
// this.form.menuCheckStrictly = true
// 设置选中
this.$refs.menu.setCheckedKeys(response.data);
// 设置为非严格,继续使用半选中
......@@ -466,7 +466,7 @@ export default {
if (this.form.id !== undefined) {
assignRoleMenu({
roleId: this.form.id,
menuIds: [...this.$refs.menu.getCheckedKeys(), ...this.$refs.menu.getHalfCheckedKeys()]
menuIds: [...this.$refs.menu.getCheckedKeys()] // , ...this.$refs.menu.getHalfCheckedKeys() 不需要半选中的,会在下次回显的时候导致子节点全部被选中
}).then(response => {
this.$modal.msgSuccess("修改成功");
this.openMenu = false;
......
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