Commit 0615d1f4 authored by houjn@hikoon.cn's avatar houjn@hikoon.cn
parents 3ae01f08 1f3c1889
......@@ -457,4 +457,10 @@ export function dataURLtoBlob(base64Data) {
type: mimeString
});
return blob;
}
// 将字符串转成数组
export function str2arr(str, separator = ','){
if(!str) return []
return str.split(separator).filter(item => item)
}
\ No newline at end of file
<script>
import Edit from './edit'
Edit.name = 'CouponDetail'
export default Edit
</script>
\ No newline at end of file
......@@ -261,6 +261,7 @@ import ProductsSelector from '@/components/ProductsSelector'
import Editor from '@/components/Editor'
import Selector from '@/components/Selector/index'
import {parseTime} from '@/utils/ruoyi'
import {str2arr} from '@/utils/index'
export default {
......@@ -304,6 +305,7 @@ export default {
},
errTips: {}, // 跟fee对应的错误提示
isAllProduct: false, // 是否全部商品
initing: false, // 初始化中,编辑或者查看的时候,初始化中修改type不改默认值
};
},
computed:{
......@@ -370,13 +372,15 @@ export default {
// 非优惠券则查询优惠券列表
if(val && val != 1){
this.getCouponSelect()
// 非优惠券给默认数据
this.$set(this.form, 'documentDeclarationArr', ["1", "2", "3"])
this.$set(this.form, 'isCargoControlArr', ["0", "1"])
this.$set(this.form, 'orderAttrArr', ["2","3","1"])
this.$set(this.form, 'brandArr', ["0","1", "2"])
this.$set(this.form, 'suitableLineType', 0)
if(!this.initing){
// 非优惠券给默认数据
this.$set(this.form, 'documentDeclarationArr', ["1", "2", "3"])
this.$set(this.form, 'isCargoControlArr', ["0", "1"])
this.$set(this.form, 'orderAttrArr', ["2","3","1"])
this.$set(this.form, 'brandArr', ["0","1", "2"])
this.$set(this.form, 'suitableLineType', 0)
}
}
// 过一遍费用,禁用/启用、同步 部分货币单位
......@@ -416,9 +420,13 @@ export default {
}
getCurrencyList().then(res => this.currencyList = res.data)
if (this.$route.query.id) {
this.initing = true
getCoupon(this.$route.query.id).then((res) => {
this.form = res.data
this.form = res.data;
['orderAttr', 'isCargoControl', 'brand', 'documentDeclaration'].forEach(field => {
this.$set(this.form, field + 'Arr', str2arr(res.data[field]))
})
// 没有商品则表示全部
if(!this.form.prodIds){
this.isAllProduct = true
......@@ -464,6 +472,10 @@ export default {
this.fee[type] = [{type}]
}
})
}).finally(() => {
this.$nextTick(() => {
this.initing = false
})
})
}
// 不是编辑查看则给默认的费用表格
......@@ -489,7 +501,14 @@ export default {
// 只要不是按产品单位满减
if(!item.combUnit || item.combUnit.split('_')[0] != 'prodUnit'){
this.$set(item, 'reduceCurrencyDisabled', true)
this.$set(item, 'reduceCurrencyId', +item.fullCurrencyId || +item.combUnit.split('_')[1])
let currencyId = +item.fullCurrencyId
if(!currencyId && item.combUnit){
currencyId = +item.combUnit.split('_')[1]
}
if(!currencyId){
currencyId = this.currencyList[0].id
}
this.$set(item, 'reduceCurrencyId', currencyId)
}
return
......@@ -639,7 +658,7 @@ export default {
}
// 没勾选全部就需要选择商品
if(!this.isAllProduct && !this.form.prodIds){
if(this.form.type != 1 && !this.isAllProduct && !this.form.prodIds){
return this.$message.error('请选择商品')
}
......
......@@ -161,7 +161,7 @@
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row, true)"
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row, true)"
v-hasPermi="['ecw:coupon:update']">查看</el-button>
<el-button v-if="scope.row.status != 1" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:coupon:update']">编辑</el-button>
......@@ -287,6 +287,9 @@ export default {
}
return this.$router.push(url)
},
handleDetail(row){
this.$router.push('detail?id=' + row.couponId + '&readonly=1')
},
handleCopy(row){
this.$router.push('edit?action=copy&id=' + row.couponId)
},
......
......@@ -106,7 +106,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(!!(customerId !== '0' && form.customerService) || isCustomerServiceConfirmed)">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(customerId !== '0' || isCustomerServiceConfirmed)">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
......
......@@ -117,7 +117,7 @@
<span>{{ parseTime(scope.row.enterOpenSeaTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName">
</el-table-column>
<el-table-column :label="$t('出货渠道')">
<template slot-scope="{row}">
......@@ -609,14 +609,6 @@ export default {
const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -98,7 +98,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName">
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
......@@ -414,10 +414,6 @@ export default {
const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh
},
customerServiceFn(row){
let obj = this.serviceStaffOptions.find(item => item.id === row.customerService)
return obj ? obj.nickname : '';
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -110,7 +110,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName">
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
......@@ -159,9 +159,11 @@ import {listServiceUser} from "@/api/system/user";
import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
export default {
name: "customerToBeAssigned",
components: {
Template,
upload,
transferCustomer
},
......@@ -426,14 +428,6 @@ export default {
this.exportLoading = false;
}).catch(() => {});
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
}
},
watch:{
selectCustomerList(val){
......
......@@ -98,7 +98,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName">
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
......@@ -227,14 +227,6 @@ export default {
const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -104,7 +104,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName" >
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
......@@ -393,14 +393,6 @@ export default {
this.isBatch = false;
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
transferFn(val){
if(!this.service){
return this.$message.warning(this.$t('请选择客户经理!'));
......
......@@ -97,7 +97,7 @@
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w-100"></el-input>
/
<selector v-model="form.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector v-model="item.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" :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"/>
......@@ -117,7 +117,7 @@
: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" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-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>
......@@ -426,6 +426,7 @@ export default {
stepPrice: 0,
advanceStatus: 0,
needBook: 0,
specialList: [],
// dayLimit: 10000,
validateEndDate: undefined,
validateStartDate: undefined,
......@@ -471,7 +472,7 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
if(!this.form.specialList || !this.form.specialList.length){
/* if(!this.form.specialList || !this.form.specialList.length){
console.log('specialList默认给[]')
this.$set(this.form, 'specialList', [])
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
......@@ -485,7 +486,22 @@ export default {
"transportVolumeUnit": null,
})
})
}
} */
console.log(this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS))
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
if(!this.form.specialList.find(special => special.specialDictType == item.value)){
this.form.specialList.push({
"clearancePrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"clearancePriceUnit": null,
"clearanceVolumeUnit": null,
"specialDictType": item.value,
"transportPrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"transportPriceUnit": null,
"transportVolumeUnit": null,
})
}
})
},
methods: {
......
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