Commit 9ba87418 authored by Administrator's avatar Administrator

Merge branch 'pre-release' into 'jd_dev'

Pre release代码合并到jd分支20241213

See merge request !105
parents 7c046fe3 5402f91a
<template>
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<template v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="$l(onlyOneChild.meta, 'title')" :badge="badge" />
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
<item :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" :title="$l(onlyOneChild.meta, 'title')" :badge="badge" />
</el-menu-item>
</app-link>
</template>
......@@ -12,27 +12,20 @@
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="$l(item.meta, 'title')" :badge="badge" />
</template>
<sidebar-item
v-for="child in item.children"
:key="child.path"
:is-nest="true"
:item="child"
:base-path="resolvePath(child.path)"
class="nest-menu"
/>
<sidebar-item v-for="(child, index) in item.children" :key="index" :is-nest="true" :item="child" :base-path="resolvePath(child.path)" class="nest-menu" />
</el-submenu>
</div>
</template>
<script>
import path from 'path'
import { isExternal } from '@/utils/validate'
import Item from './Item'
import AppLink from './Link'
import FixiOSBug from './FixiOSBug'
import path from "path"
import { isExternal } from "@/utils/validate"
import Item from "./Item"
import AppLink from "./Link"
import FixiOSBug from "./FixiOSBug"
export default {
name: 'SidebarItem',
name: "SidebarItem",
components: { Item, AppLink },
mixins: [FixiOSBug],
props: {
......@@ -47,24 +40,24 @@ export default {
},
basePath: {
type: String,
default: ''
default: ""
}
},
data() {
this.onlyOneChild = null
return {}
},
computed:{
badge(){
computed: {
badge() {
return this.$store.getters.badgeData[this.item.meta?.badgeField]
}
},
methods: {
hasOneShowingChild(children = [], parent) {
if (!children) {
children = [];
children = []
}
const showingChildren = children.filter(item => {
const showingChildren = children.filter((item) => {
if (item.hidden) {
return false
} else {
......@@ -81,7 +74,7 @@ export default {
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
this.onlyOneChild = { ...parent, path: "", noShowingChildren: true }
return true
}
......
......@@ -213,19 +213,27 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productTypes">
<el-form-item :label="$t('主营类别')" prop="products">
<div style="overflow: hidden">
<div style="margin-bottom: 10px" v-for="(ITEM, INDEX) in form.products" :key="INDEX">
<el-row :gutter="10">
<el-col :span="11">
<el-select @change="change" v-model="form.productTypes" filterable multiple :placeholder="$t('请选择产品类别')">
<el-col :span="9">
<el-select @change="change(INDEX, $event)" v-model="form.products[INDEX].typeId" filterable :placeholder="$t('请选择产品类别')">
<el-option :label="isChinese ? item.titleZh : item.titleEn" :value="item.id" v-for="item in productTypeList" :key="item.id" />
</el-select>
</el-col>
<el-col :span="11">
<el-select @change="productIdsChange" multiple filterable clearable v-model="form.productIds" :placeholder="$t('请选择')">
<el-option :label="`${isChinese ? item.typeTitleZh : item.typeTitleEn}: ${item.titleZh}`" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
<el-col :span="9">
<el-select @change="productIdsChange(INDEX, $event)" multiple filterable clearable v-model="form.products[INDEX].productIds" :placeholder="$t('请选择')">
<el-option :label="`${item.titleZh}`" :value="parseInt(item.id)" v-for="item in form.products[INDEX].productList" :key="item.id" />
</el-select>
</el-col>
<el-col :span="6">
<el-button type="danger" @click="form.products.splice(INDEX, 1)" style="padding: 10px" :disabled="!INDEX"><i class="el-icon-minus"></i></el-button>
<el-button type="primary" @click="handleAddProduct" style="padding: 10px" v-if="INDEX === form.products.length - 1"><i class="el-icon-plus"></i></el-button>
</el-col>
</el-row>
</div>
</div>
</el-form-item>
</el-col>
......@@ -695,8 +703,8 @@ export default {
}
// 掉入公海时间
this.enterOpenSeaTime = this.form.estimateEnterOpenSeaTime || this.form.enterOpenSeaTime || undefined
if (!this.form.customerService || (this.form.customerService !== user.state.id)){
console.log(!this.form.customerService? "当前客户没有客户经理" : "与当前登录用户的客户经理不同")
if (!this.form.customerService || this.form.customerService !== user.state.id) {
console.log(!this.form.customerService ? "当前客户没有客户经理" : "与当前登录用户的客户经理不同")
// 当前客户没有客户经理,或者与当前登录用户的客户经理不同, 可以不校验部分必填字段
// 2024-12-03 客户-编辑,当客户所属客户经理非当前用户,保存必填校验去掉客户类别,常用提货网点,业务国家,主营类别
// 2024-12-05 客户-编辑,当客户所属客户经理非当前用户,保存必填校验去补充掉竞争对手
......@@ -760,7 +768,7 @@ export default {
}
})
// 判断当前客登录用户是否为当前客户的客户经理
this.getProductListFn([])
this.getProductListFn(0, [undefined])
} else {
this.getZhongPao()
// 新建客户
......@@ -768,7 +776,8 @@ export default {
if (this.isCustomerServiceConfirmed) {
this.form.customerService = this.userId
}
this.getProductListFn([])
this.form.products.push({ typeId: undefined, productIds: [], productList: [] })
this.getProductListFn(0, [undefined])
}
getNodeList().then((r) => {
......@@ -806,6 +815,13 @@ export default {
form: {},
// 表单校验
rules: {
products: [
{
required: true,
trigger: "blur",
validator: this.productsValidator
}
],
name: [
{
required: true,
......@@ -906,7 +922,7 @@ export default {
// 网点
nodeList: [],
productTypeList: [],
productList: [],
productList: {},
showZhong: false,
showZhong1: false,
showPao: false,
......@@ -941,25 +957,31 @@ export default {
deleteEmail(row, index) {
row.splice(index, 1)
},
change(val) {
this.form.productIds = []
this.getProductListFn(val)
change(INDEX, val) {
this.form.products[INDEX].productIds = []
this.getProductListFn(INDEX, [val])
this.$refs["form"].validateField("products")
},
getProductListFn(val) {
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data
getProductListFn(INDEX, val) {
getProductList({ typeIds: !val[0] ? [] : val }).then((r) => {
this.form.products[INDEX].productList = r.data
})
},
productIdsChange(val) {
console.log(val)
let typeIds = this.productList.filter((item) => val.indexOf(item.id) > -1).map((item) => item.typeId)
handleAddProduct() {
this.form.products.push({ typeId: undefined, productIds: [], productList: [] })
this.getProductListFn(this.form.products.length - 1, [undefined])
},
productIdsChange(INDEX, val) {
let typeIds = this.form.products[INDEX].productList.filter((item) => val.indexOf(item.id) > -1).map((item) => item.typeId)
typeIds = [...new Set(typeIds)]
console.log(typeIds)
typeIds.forEach((item) => {
if (this.form.productTypes.indexOf(item) < 0) {
this.form.productTypes.push(item)
let typeId = undefined
if (typeIds.length) {
typeId = typeIds[0]
}
if (typeId !== this.form.products[INDEX].typeId) {
this.form.products[INDEX].typeId = typeId
this.getProductListFn(INDEX, [typeId])
}
})
},
deleteBankData(index) {
this.form.customerBanks.splice(index, 1)
......@@ -992,6 +1014,22 @@ export default {
this.customerSelect = res.data.list
})
},
productsValidator(rule, value, callback) {
let r = this.form.products.some((item) => {
if (!item.typeId) {
callback(new Error(this.$t("主营类别不能为空")))
return true
}
})
let typeIds = this.form.products.map((item) => item.typeId)
if (new Set(typeIds).size !== typeIds.length) {
callback(new Error(this.$t("主营类别不能重复")))
return
}
if (!r) {
callback()
}
},
phoneValidator(rule, value, callback) {
if (!value) {
return callback(new Error(this.$t("请输入联系方式")))
......@@ -1105,6 +1143,9 @@ export default {
this.$modal.msgError(this.$t("请重新选择主要竞争对手"))
return
}
if (this.form.competitorIds == 0 && !this.potential) {
return
}
// 重货标准和泡货标准,未打开就不传,提交前清空一下
if (!this.showZhong) {
......@@ -1212,6 +1253,7 @@ export default {
productTypes: [],
pickupPoints: [],
productIds: [],
products: [],
memberId: undefined,
birthday: undefined,
balance: undefined,
......@@ -1279,9 +1321,15 @@ export default {
competitorIds: Number(response.data.competitorIds),
productTypes: this.stringArrToNumberArr(response.data.productTypes)
}
if (this.form.productTypes.length) {
this.getProductListFn(this.form.productTypes)
if (!this.form.products) {
this.form.products = []
}
if (!this.form.products.length) {
this.form.products.push({ typeId: undefined, productIds: [], productList: [] })
}
this.form.products.forEach((ITEM, INDEX) => {
this.getProductListFn(INDEX, [ITEM.typeId])
})
console.log(this.form)
......
......@@ -164,8 +164,8 @@
<el-date-picker type="datetimerange" clearable v-model="firstDealTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker type="datetimerange" clearable v-model="dateRangeCreateTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
<el-form-item :label="$t('创建时间')">
<el-date-picker type="datetimerange" clearable v-model="createTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item style="padding-left: 20px">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
......@@ -794,7 +794,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
......@@ -890,6 +889,7 @@ export default {
enterOpenSeaTime: [],
customerServiceConfirmedTime: [],
firstDealTime: [],
createTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
......@@ -966,14 +966,14 @@ export default {
queryParams.beginCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[0]
queryParams.endCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.createTime && this.createTime.length == 2) {
queryParams.beginCreateTime = this.createTime[0]
queryParams.endCreateTime = this.createTime[1]
}
if (this.weightYearly.value) {
let key = "eqWeightYearly"
if (this.weightYearly.key == "leNumberKey") {
......@@ -1006,10 +1006,13 @@ export default {
},
created() {
console.log("created")
getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list
})
this.getList()
// 获取当前时间的年份开始时间与结束时间值,并赋值给创建时间,再查询当年创建的客户
this.getCurrentYearList()
// this.getList()
listServiceUser().then((r) => {
this.customerServiceList = r.data
})
......@@ -1062,6 +1065,17 @@ export default {
})
}
},
getCurrentYearList(){
const today = new Date();
const targetday_milliseconds = today.getTime();
today.setTime(targetday_milliseconds); //注意,这行是关键代码
const tYear = today.getFullYear();
console.log("年份:", tYear)
if (tYear){
this.createTime = [(tYear + "-01-01 00:00:00"),(tYear + "-12-31 23:59:59")]
}
this.getList()
},
//合并客户
handleMergeCus() {
this.customerMergeVisible = true
......@@ -1170,12 +1184,7 @@ export default {
this.loading = true
// 处理查询参数}
let params = { ...this.queryParams, ...this.combinedQueryParams }
/*this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);*/
// 执行查询
switch (this.$route.path) {
case "/customer/customer":
......@@ -1344,10 +1353,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = []
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.createTime = []
this.resetForm("queryForm")
this.queryParams = {
pageNo: 1,
......
......@@ -1873,10 +1873,10 @@ export default {
// 校验手机号跟目的国是否匹配
if (this.hasConsignee && this.form.consigneeCountryCode && this.form.consigneePhone) {
if (this.form.consigneeCountryCode == "86" || this.form.consigneeCountryCode == "+86") {
this.$message.error(this.$t("控货订单的收货人手机号不能是国内号码"))
return
}
// if (this.form.consigneeCountryCode == "86" || this.form.consigneeCountryCode == "+86") {
// this.$message.error(this.$t("控货订单的收货人手机号不能是国内号码"))
// return
// }
const res = await checkCountryCode({
areaCode: this.form.consigneeCountryCode,
currencyId: this.form.destCountryId
......
......@@ -17,11 +17,11 @@
<!-- <el-form-item :label="$t('唛头')" prop="marks">
<el-input v-model="queryParams.marks" :placeholder="$t('唛头')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item :label="$t('发货人电话')" prop="consigneeKey">
<el-input v-model.trim="queryParams.consignorPhone" :placeholder="$t('发货人电话')" clearable @keyup.enter.native="handleQuery" class="w-200"/>
<el-form-item :label="$t('发货人电话')" prop="consignorPhone">
<el-input v-model.trim="queryParams.consignorPhone" :placeholder="$t('发货人电话')" clearable @keyup.enter.native="handleQuery" @input="queryParams.consignorPhone = queryParams.consignorPhone.replace(/\s+/g, '')" class="w-200"/>
</el-form-item>
<el-form-item :label="$t('收货人电话')" prop="consigneeKey">
<el-input v-model.trim="queryParams.consigneePhone" :placeholder="$t('收货人电话')" clearable @keyup.enter.native="handleQuery" class="w-200"/>
<el-form-item :label="$t('收货人电话')" prop="consignorPhone">
<el-input v-model.trim="queryParams.consigneePhone" :placeholder="$t('收货人电话')" clearable @keyup.enter.native="handleQuery" @input="queryParams.consigneePhone = queryParams.consigneePhone.replace(/\s+/g, '')" class="w-200"/>
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl" v-show="showSearch">
......@@ -340,7 +340,7 @@
<el-dropdown-menu slot="dropdown">
<!--出货订单编辑,shipmentState > 0表示出货后,inWarehouseState == 0 表示预装未审核或者是卸柜到仓 , shipmentState==307 表示已预装,待封柜, shipmentState==407 表示已预装,待封柜)-->
<template
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0 && scope.row.shipmentState != 305 && scope.row.shipmentState != 307 && scope.row.shipmentState != 407"
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0 && exclude(scope.row.shipmentState, [305, 307, 309, 310, 311, 313, 407,409,411])"
>
<el-dropdown-item
@click.native="handleUpdate(scope.row)"
......@@ -497,7 +497,7 @@
</template>
<!-- 入仓补充 -->
<template
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0 && scope.row.shipmentState != 305 && scope.row.shipmentState != 307 && scope.row.shipmentState != 407"
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0 && exclude(scope.row.shipmentState, [305, 307, 309, 310, 311, 313, 407,409,411])"
>
<el-dropdown-item
@click.native="$router.push('/order/warehousing-add?shipment=1&id=' + scope.row.orderId)"
......@@ -525,7 +525,8 @@
</template>
<!-- 入仓修改 -->
<template
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0 && scope.row.shipmentState != 305 && scope.row.shipmentState != 307 && scope.row.shipmentState != 407"
v-if="scope.row.shipmentState > 0 && scope.row.inWarehouseState == 0
&& exclude(scope.row.shipmentState, [305, 307, 309, 310, 311, 313, 407,409,411])"
>
<el-dropdown-item
@click.native="$router.push('/order/warehousing-update?shipment=1&id=' + scope.row.orderId)"
......
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