Commit b5358ce3 authored by dcy's avatar dcy

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

parents 3d905e4f c24bb6cf
import request from '@/utils/request'
// 创建广告弹窗
export function createBannerPop(data) {
return request({
url: '/ecw/banner-pop/create',
method: 'post',
data: data
})
}
// 更新广告弹窗
export function updateBannerPop(data) {
return request({
url: '/ecw/banner-pop/update',
method: 'put',
data: data
})
}
// 删除广告弹窗
export function deleteBannerPop(id) {
return request({
url: '/ecw/banner-pop/delete?id=' + id,
method: 'delete'
})
}
// 获得广告弹窗
export function getBannerPop(id) {
return request({
url: '/ecw/banner-pop/get?id=' + id,
method: 'get'
})
}
// 获得广告弹窗分页
export function getBannerPopPage(query) {
return request({
url: '/ecw/banner-pop/page',
method: 'get',
params: query
})
}
// 导出广告弹窗 Excel
export function exportBannerPopExcel(query) {
return request({
url: '/ecw/banner-pop/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
// 创建优惠券信息
export function createCoupon(data) {
return request({
url: '/ecw/coupon/createOrUpdate',
method: 'post',
data: data
})
}
// 更新优惠券信息
export function updateCoupon(data) {
return request({
url: '/ecw/coupon/createOrUpdate',
method: 'post',
data: data
})
}
// 删除优惠券信息
export function deleteCoupon(id) {
return request({
url: '/ecw/coupon/delete?id=' + id,
method: 'delete'
})
}
// 获得优惠券信息
export function getCoupon(id) {
return request({
url: '/ecw/coupon/get?id=' + id,
method: 'get'
})
}
// 获得优惠券信息分页
export function getCouponPage(query) {
return request({
url: '/ecw/coupon/page',
method: 'get',
params: query
})
}
// 导出优惠券信息 Excel
export function exportCouponExcel(query) {
return request({
url: '/ecw/coupon/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -43,6 +43,15 @@ export function getCustomerPage(query) {
})
}
// 获得客户下来
export function getCustomerSelect(query) {
return request({
url: '/ecw/customer/select',
method: 'get',
params: query
})
}
// 导出客户 Excel
export function exportCustomerExcel(query) {
return request({
......
......@@ -34,6 +34,14 @@ export function getProduct(id) {
})
}
// 获得产品列表
export function getProductList() {
return request({
url: '/ecw/product/list',
method: 'get'
})
}
// 获得产品分页
export function getProductPage(query) {
return request({
......
<template>
<el-row class="" :gutter="10">
<el-col :span="10">
<el-card>
<div slot="header" class="header">
<el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" />
<dict-selector :type="DICT_TYPE.USER_TYPE" v-model="queryParams.customerType" style="width:100px" />
<el-button type="primary" @click="reLoad">搜搜1</el-button>
</div>
<div class="list">
<div class="item" v-for="item in list" :key="item.id">
<el-link class="el-icon-plus" @click="choose(item)" :disabled="customerIds.indexOf(item.id) > -1" />
{{item.name}}{{item.defaultContactName}}
</div>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card>
<div slot="header" class="header">
已选客户
</div>
<div class="list">
<div class="item" v-for="item in choosedList" :key="item.id">
<el-link class="el-icon-delete" @click="remove(item)" />
{{item.name}}{{item.defaultContactName}}
</div>
</div>
</el-card>
</el-col>
</el-row>
</template>
<script>
import {getCustomerSelect} from '@/api/ecw/customer'
export default {
data(){
return {
list:[],
/* page: 1,
pages: 1, */
queryParams:{
page: 1,
name: null,
level: null
},
choosedList:[]
}
},
computed:{
customerIds(){
let arr = []
this.choosedList.forEach(item => {
arr.push(item.id)
})
return arr
}
},
watch:{
customerIds(val){
this.$emit('input', val)
}
},
created(){
this.reLoad()
},
methods:{
reLoad(){
this.queryParams.page = 1
this.list = []
this.getList()
},
loadNextPage(){
if(this.page >= this.pages){
return this.$message.error('已加载全部')
}
this.queryParams.page ++
this.getList()
},
getList(){
getCustomerSelect(this.queryParams).then(res => {
this.list = res.data
})
},
choose(customer){
this.choosedList.push(customer)
},
remove(customer){
this.choosedList.forEach((item,index) => {
if(item.id==customer.id) this.choosedList.splice(index,1)
})
}
}
}
</script>
<style scoped lang="scss">
.header{
>div{
margin-right: 5px;
}
}
.list{
height: 200px;
border: 1px solid #ccc;
overflow-y: auto;
overflow-x: hidden;
padding: 0 10px;
}
</style>
\ No newline at end of file
<template>
<el-select v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple">
<el-option v-for="dict in getList(type)"
<div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple">
<el-option v-for="dict in dictList"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync">
<el-radio v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-radio>
</el-radio-group>
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync">
<el-checkbox v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox>
</el-checkbox-group>
</div>
</template>
<script>
const selfDefinedDict = {
_yesno: [
{label: '', value: '1'},
{label: '', value: '0'}
]
}
export default {
props:{
placeholder: {
......@@ -20,14 +22,24 @@ export default {
type: String,
value: [String, Number, Array],
multiple: Boolean,
formType:{
type: String,
default: 'select'
},
forceString: {
type: Boolean,
default: true
}
},
defaultable: Boolean, // 是否默认选择第一个
},
data(){
return {
valueSync: null
valueSync: this.multiple ? [] : null
}
},
computed:{
dictList(){
return this.getList(this.type)
}
},
watch:{
......@@ -36,21 +48,36 @@ export default {
},
value(val){
this.setValueSync()
},
dictList(){
this.setDefault()
}
},
created(){
this.setValueSync()
this.setDefault()
},
methods:{
setValueSync(){
if(!this.value || this.value == '') return
if(this.forceString && this.multiple){
this.valueSync = val.split(',')
this.valueSync = this.value.split(',')
}else this.valueSync = this.forceString ? String(this.value) : this.value
},
getList(){
return selfDefinedDict[this.type] || this.getDictDatas(this.type)
return this.getDictDatas(this.type)
},
setDefault(){
if(!this.defaultable) return
if(this.dictList.length && (this.valueSync === null || this.valueSync == '')){
this.valueSync = this.dictList[0].value
}
}
}
}
</script>
<style scoped>
.dict-selector{
display: inline-block;
}
</style>
\ No newline at end of file
......@@ -172,11 +172,11 @@ export default {
// 获取富文本组件实例
let quill = this.Quill;
// 如果上传成功
if (res.code == 200) {
if (res.code == 0) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片 res.url为服务器返回的图片地址
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
quill.insertEmbed(length, "image", res.data);
// 调整光标到最后
quill.setSelection(length + 1);
} else {
......@@ -186,6 +186,20 @@ export default {
handleUploadError() {
this.$message.error("图片插入失败");
},
uuid() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
},
},
};
</script>
......
<template>
<el-row class="" :gutter="10">
<el-col :span="10">
<el-card>
<div slot="header" class="header">
<el-select v-model="queryParams.typeId" placeholder="选择类型" style="width:120px" clearable>
<el-option v-for="item in typeList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<el-select v-model="queryParams.attrId" placeholder="选择属性" style="width:120px" clearable>
<el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" />
</el-select>
<el-input v-model="queryParams.titleZh" placeholder="产品关键字" style="width:120px" clearable />
<el-button type="primary" @click="reLoad">搜搜</el-button>
</div>
<div class="list">
<div class="item" v-for="item in list" :key="item.id">
<el-checkbox @change="toggleCheck(item, $event)" :value="ids.indexOf(item.id) > -1" /> {{item.titleZh}}
<div>{{item.titleEn}}</div>
</div>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card>
<div slot="header" class="header">
已选产品
</div>
<div class="list">
<div class="item" v-for="(choosed) in choosedList" :key="choosed.id" :data-data="JSON.stringify(choosed)">
<el-link class="el-icon-delete" @click="remove(choosed)" /> {{choosed.titleZh}}
<div>{{choosed.titleEn}}</div>
</div>
</div>
</el-card>
</el-col>
</el-row>
</template>
<script>
import {getProductPage} from '@/api/ecw/product'
import {getProductTypeList} from '@/api/ecw/productType'
import {getProductAttrList} from '@/api/ecw/productAttr'
export default {
data(){
return {
list:[],
page: 1,
pages: 1,
queryParams:{
page: 1,
attrId: null,
titleZh: null,
typeId: null
},
choosedList:[],
typeList:[],
attrList:[]
}
},
computed:{
ids(){
let arr = []
this.choosedList.forEach(item => {
arr.push(item.id)
})
return arr
}
},
watch:{
ids(val){
this.$emit('input', val)
}
},
created(){
getProductTypeList().then(res => this.typeList = res.data)
getProductAttrList().then(res => this.attrList = res.data)
this.reLoad()
},
methods:{
reLoad(){
this.queryParams.page = 1
this.list = []
this.getList()
},
loadNextPage(){
if(this.page >= this.pages){
return this.$message.error('已加载全部')
}
this.queryParams.page ++
this.getList()
},
getList(){
getProductPage(this.queryParams).then(res => {
this.list = res.data.list //.concat(res.data.list || [])
this.page = res.data.page
this.pages = res.data.pages
})
},
toggleCheck(item, checked){
if(checked){
this.choose(item)
}else{
this.remove(item)
}
},
choose(item){
this.choosedList.push(item)
},
remove(item){
this.choosedList.forEach((choosed,index) => {
if(choosed.id==item.id) this.choosedList.splice(index,1)
})
}
}
}
</script>
<style scoped lang="scss">
.header{
>div{
margin-right: 5px;
}
}
.list{
height: 200px;
border: 1px solid #ccc;
overflow-y: auto;
overflow-x: hidden;
padding: 0 10px;
display: flex;
flex-wrap: wrap;
.item{
width: 50%;
line-height: 20px;
height: 50px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>
\ No newline at end of file
<template>
<el-select v-model="valueSync" :multiple="multiple">
<el-option v-for="item in optionsFormated" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template>
<script>
export default {
data(){
return {
valueSync: null
}
},
props:{
options: Array,
value: [String, Number, Boolean, Object],
labelField: {
type: String,
default: 'label'
},
valueField: {
type: String,
default: 'value'
},
multiple: Boolean,
clearable: Boolean,
defaultable: Boolean, // 没有值的时候是否选择第一项
},
computed:{
optionsFormated(){
let arr = []
this.options.forEach(item => {
arr.push({
label: item[this.labelField],
value: item[this.valueField]
})
})
return arr
}
},
watch:{
valueSync(val){
this.$emit('input', val)
},
value(value){
this.valueSync = value
},
optionsFormated(){
this.setDefault()
}
},
created(){
this.valueSync = this.value
this.setDefault()
},
methods:{
setDefault(){
if(!this.defaultable){
return false
}
if(this.optionsFormated.length && (this.valueSync == null || this.valueSync == '')){
this.valueSync = this.optionsFormated[0].value
}
}
}
}
</script>
\ No newline at end of file
......@@ -2,6 +2,7 @@ import Vue from 'vue'
import Router from 'vue-router'
/* Layout */
import Layout from '@/layout'
import query from '@/views/ecw/customer/query'
Vue.use(Router)
......@@ -91,16 +92,6 @@ export const constantRoutes = [
meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'}
}
]
}, {
path: '/c',
component: Layout,
hidden: true,
children: [{
path: 'ecw/customer/edit/:customerId(\\d+)',
component: (resolve) => require(['@/views/ecw/customer/edit'], resolve),
name: 'Data',
meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'}
}]
}, {
path: '/job',
component: Layout,
......@@ -214,6 +205,21 @@ export const constantRoutes = [
]
},
// {
// path: '/product',
// component: Layout,
// hidden: true,
// redirect: 'noredirect',
// children: [{
// path: 'product-black',
// component: (resolve) => require(['@/views/ecw/productPrice/index'], resolve),
// name: 'ProductPrice',
// meta: {title: '黑名单产品列表', activeMenu: '/product/product-black'}
// }
// ]
// },
{
path: '/shelf',
component: Layout,
......@@ -232,12 +238,28 @@ export const constantRoutes = [
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [{
children: [
{
path: '/customerCommissionInfo/:dictId(\\d+)',
component: (resolve) => require(['@/views/ecw/customerCommissionInfo/index'], resolve),
name: 'customerCommissionInfo',
meta: {title: '佣金详情', icon: '', activeMenu: '/customer/customerCommissionInfo'}
}]
},
{
path: 'edit/:customerId(\\d+)',
component: (resolve) => import('@/views/ecw/customer/edit'),
props: true,
name: 'customerEdit',
meta: {title: '编辑客户', icon: '', activeMenu: '/customer/customer'}
},
{
path: 'query/:customerId(\\d+)',
component: (resolve) => import('@/views/ecw/customer/query'),
props: true,
name: 'customerQuery',
meta: {title: '客户详情', icon: '', activeMenu: '/customer/customer'}
}
]
},
]
......
......@@ -68,6 +68,20 @@ export const DICT_TYPE = {
ECW_PACKAGING_TYPE: 'packaging_type', //包装要求
ECW_CONTAINER_LOCATION: 'container_location', //默认货柜位置
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS: 'special_req_for_line_products', // 特殊需求
ECW_COUPON_TYPE: 'coupon_type', // 优惠券类型
ECW_COUPON_STATUS: 'coupon_status', // 优惠券状态
ECW_COUPON_COST_TYPE: 'coupon_cost_type', // 优惠券费用类型
ECW_COUPON_OVERDUE_STATUS: 'coupon_overdue_status', // 优惠券状态
ECW_COUPON_PUTON_STATUS: 'coupon_puton_status',
ECW_SUITABLE_USER_TYPE:'suitable_user_type', // 适用用户类型
ECW_SUITABLE_LINE_TYPE: 'suitable_line_type', // 适用线路类型
ECW_SUITABLE_PROD_TYPE: 'suitable_prod_type', // 适用产品类型
ECW_ORDER_ATTR: 'order_attr', // 订单属性
ECW_YESNO: 'yesno', // 是否 1,0
ECW_COMPANY_TYPE: 'company_type', // 供应商类别
ECW_COOPERATION_TYPE: 'cooperation_type', // 合作类型
ECW_SHIPPING_DECLARATION_TYPE: 'shipping_declaration_type', // 出货报关方式(与订单报关方式相同)
ECW_CUSTOMS_TYPE: 'customs_type', // 订单报关方式(非出货报关),优惠券中的单证报关
//--------ecw---------
CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source',
......@@ -91,7 +105,8 @@ export const DICT_TYPE = {
COMMISSION_TYPE:'commission_type',//佣金类型
COMMISSION_DARK_TYPE :'commission_dark_type',//暗涌类型
COMMISSION_CURRENCY_TYPE:'commission_currency_type',//佣金货币类型
COMMISSION_UNIT:'commission_unit'//佣金货物单位
COMMISSION_UNIT:'commission_unit',//佣金货物单位
ECW_PORT_TYPE:'port_type', //港口类型
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -74,16 +74,16 @@
</el-col>
<el-col :span="12">
<el-form-item label="主营类别" prop="productType">
<el-cascader :options="productTypeList" :props="{label: 'titleZh', value: 'id', lazy: true, lazyLoad}"></el-cascader>
<!-- <el-cascader :options="productTypeList" :props="{label: 'titleZh', value: 'id', lazy: true, lazyLoad}"></el-cascader>-->
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择产品类别">
<!-- <el-option label="请选择字典生成" value="" />-->
<el-select v-model="form.productType" placeholder="请选择产品类别" @change="form.productId = ''">
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择主营类别">
<!-- <el-option label="请选择字典生成" value="" />-->
<el-select v-model="form.productId" placeholder="请选择">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productListFilter" :key="item.id"/>
</el-select>
</el-col>
</el-row>
......@@ -168,15 +168,26 @@
<el-table
v-show="showLine"
border
:data="form.customerLines"
:data="warehouseList"
style="width: 500px">
<el-table-column
prop="departureId"
label="始发地">
<template v-slot="{row}">
<el-checkbox>{{ row.titleZh }}</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="objectiveId"
label="目的地">
<el-select multiple placeholder="请选择">
<el-option
v-for="item in importCityList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-table-column>
</el-table>
</el-form-item>
......@@ -359,29 +370,41 @@ import upload from '@/components/ImageUpload'
import {createCustomer, getCustomer, updateCustomer} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType'
import { getProductList } from '@/api/ecw/product'
import {getTradeCityList} from "@/api/ecw/region"
import {getWarehouseList} from "@/api/ecw/warehouse"
export default {
name: "edit",
props: {
customerId: String
},
components: {
upload
},
created() {
this.customerId = this.$route.params && this.$route.params.customerId;
console.log(this.customerId)
if(!!this.customerId)
this.reset()
if(this.customerId !== '0')
this.getCustomer(this.customerId)
getNodeList().then(r => {
this.nodeList = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
getWarehouseList().then(r => {
this.warehouseList = r.data
})
},
data(){
return {
customerId: undefined,
getDictDatas,
DICT_TYPE,
......@@ -402,12 +425,17 @@ export default {
// 网点
nodeList: [],
productTypeList: [],
showLine: false
productList: [],
showLine: false,
warehouseList: [],
importCityList: []
}
},
methods: {
lazyLoad(node, resolve) {
const r = this.productList.filter((p) => p.typeId === node.value)
console.log(r)
resolve(r)
},
/** 取消按钮 */
cancel() {
......@@ -418,7 +446,7 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
// return;
return;
}
// 修改的提交
if (this.form.id != null) {
......@@ -475,18 +503,22 @@ export default {
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
createTime: undefined
};
this.resetForm("form");
},
getCustomer(id) {
this.reset();
getCustomer(id).then(response => {
this.form = { ...this.form, ...response.data };
this.open = true;
this.title = "修改客户";
});
}
},
computed: {
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
}
}
}
</script>
......
......@@ -91,6 +91,8 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="['ecw:customer:query']">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:customer:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
......@@ -600,6 +602,10 @@ export default {
// this.open = true;
// this.title = "添加客户";
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id)
......
This diff is collapsed.
<template>
<view>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<h2></h2>
<el-row :gutter="10">
<el-col>
<h2>查看</h2>
</el-col>
<el-col>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="danger">危险按钮</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
</view>
</template>
<script>
export default {
name: 'view'
}
</script>
<style scoped>
</style>
......@@ -20,6 +20,15 @@
<el-table-column label="中文名称" align="center" prop="titleZh" />
<el-table-column label="英文名称" align="center" prop="titleEn" />
<el-table-column prop="portType" label="港口类型" align="center">
<template slot-scope="scope">
<div>
{{ portTypeName(scope.row.portType) }}
</div>
</template>
</el-table-column>
<el-table-column label="国家" align="center" prop="countryZh" />
<el-table-column label="省" align="center" prop="provinceZh" />
<el-table-column label="城市" align="center" prop="cityZh" />
......@@ -88,6 +97,11 @@
</el-select>
</el-form-item>
<el-form-item label="港口类型" prop="portType">
<el-select v-model="form.portType" placeholder="请选择">
<el-option v-for="dict in portTypeDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="码头编号" prop="number">
<el-input v-model="form.number" placeholder="请输入码头编号" />
......@@ -107,6 +121,7 @@
<script>
import { createDock, updateDock, deleteDock, getDock, getDockPage, exportDockExcel } from "@/api/ecw/dock";
import { getListTree } from "@/api/ecw/region";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
export default {
name: "Dock",
......@@ -163,10 +178,24 @@ export default {
titleZh: [{ required: true, message: "中文名称不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
}
},
portTypeDatas: getDictDatas(DICT_TYPE.ECW_PORT_TYPE)
};
},
computed: {
portTypeName() {
return portType => {
for(let index in this.portTypeDatas) {
let portTypeItem = this.portTypeDatas[index];
if(portTypeItem.value == portType) {
return portTypeItem.label;
}
}
}
},
},
watch: {
'form.countryId'(newV, oldV) {
if(oldV && oldV != newV) {
......
......@@ -338,7 +338,8 @@ export default {
this.$router.push({
name:'ProductPrice',
query: {
product_id: row.id
product_id: row.id,
product_type: row.typeId
}
})
},
......
This diff is collapsed.
......@@ -20,7 +20,7 @@
<el-form-item label="路线" v-if="form.warehouseLineDO">
<el-input :value="'【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, form.warehouseLineDO.transportType) + '】从【'+form.warehouseLineDO.startTitleZh+'】发往【'+form.warehouseLineDO.destTitleZh+'】'" disabled />
</el-form-item>
<router-selector v-if="!form.id" v-model="selectedRoutes" />
<routers-selector v-if="!form.id" v-model="selectedRoutes" />
<el-card style="margin-bottom: 10px">
<div slot="header" style="font-size:20px;">
价格设置
......@@ -155,7 +155,7 @@
</div>
</template>
<script>
import RouterSelector from '@/components/RouterSelector'
import RoutersSelector from '@/components/RoutersSelector'
import { createProductPrice, updateProductPrice, deleteProductPrice, getProductPrice, getProductPricePage, exportProductPriceExcel } from "@/api/ecw/productPrice";
import { getProduct } from '@/api/ecw/product'
import { getProductType, getProductTypeList } from '@/api/ecw/productType'
......@@ -164,7 +164,7 @@ import { getUnitList } from '@/api/ecw/unit';
import ProductSelector from '@/components/ProductSelector'
import {arrryToKeyedObjectBy} from '@/utils/index'
export default {
components: {RouterSelector, ProductSelector},
components: {RoutersSelector, ProductSelector},
data(){
return {
selectedRoutes: [], // 勾选的路线渠道
......
......@@ -44,7 +44,7 @@
</el-select>
</el-form-item>
<el-form-item label="" prop="blacklist">
<el-form-item label="" prop="blacklist" v-if="false">
<el-checkbox v-model="queryParams.blacklist"
:true-label="1" :false-label="0">黑名单</el-checkbox>
</el-form-item>
......@@ -506,6 +506,16 @@ export default {
}
},
activated() {
let typeId = this.$route.query.product_type;
if(typeId) {
if(!this.queryParams.typeId || this.queryParams.typeId != typeId)
this.$set(this.queryParams, 'typeId', typeId);
// this.queryParams.typeId = typeId;
this.getList();
}
},
created() {
// this.transportDatas = getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE);
// console.log(this.transportDatas);
......@@ -513,6 +523,8 @@ export default {
// console.log(productJson);
this.product = eval('(' + productJson + ')');
let typeListJson = localStorage.getItem('typeList');
if(typeListJson) {
this.typeList = eval('(' + typeListJson + ')');
......
......@@ -44,10 +44,10 @@
<el-option v-for="dict in this.getDictDatas('company_type')"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select-->
<dict-selector type="company_type" v-model="queryParams.companyType" />
<dict-selector :type="DICT_TYPE.COMPANY_TYPE" v-model="queryParams.companyType" />
</el-form-item>
<el-form-item label="合作类型" prop="cooperationType">
<dict-selector type="cooperation_type" v-model="queryParams.cooperationType" />
<dict-selector :type="DICT_TYPE.ECW_COOPERATION_TYPE" v-model="queryParams.cooperationType" />
<!--el-select v-model="queryParams.cooperationType" placeholder="请选择合作类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select-->
......@@ -65,7 +65,7 @@
<!-- <el-select v-model="queryParams.status" placeholder="请选择是否展示 默认为展示" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select> -->
<dict-selector type="_yesno" v-model="queryParams.status" />
<dict-selector :type="DICT_TYPE.ECW_YES_NO" v-model="queryParams.status" />
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
......
......@@ -54,6 +54,7 @@
<el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['infra:codegen:delete']">删除</el-button>
<el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['infra:codegen:update']">同步</el-button>
<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['infra:codegen:download']">生成代码</el-button>
<el-button type="text" size="small" icon="el-icon-download" @click="generateValidateCode(scope.row)">生成验证配置</el-button>
</template>
</el-table-column>
</el-table>
......@@ -101,7 +102,7 @@
</template>
<script>
import { getCodegenTablePage, previewCodegen, downloadCodegen, deleteCodegen,
import {getCodegenDetail, getCodegenTablePage, previewCodegen, downloadCodegen, deleteCodegen,
syncCodegenFromDB, syncCodegenFromSQL, createCodegenListFromSQL } from "@/api/infra/codegen";
import importTable from "./importTable";
......@@ -371,7 +372,35 @@ export default {
this.getList();
});
});
},
generateValidateCode(row){
let l = this.$loading()
getCodegenDetail(row.id).then(res => {
let rules = {}
res.data.columns.forEach(item => {
let rule = {trigger: 'blur'}
if(!item.nullable){
rule.required = true
rule.message = '不能为空'
}
if(['int', 'tinyint', 'bigint'].indexOf(item.columnType)){
rule.type = 'integer'
}
if(item.columnType.indexOf('decimal') === 0){
rule.type = 'decimal'
}
if(item.columnType == 'datetime'){
rule.type = 'date'
}
rules[item.javaField] = [rule]
})
console.log(row.tableComment + '校验规则', JSON.stringify(rules))
this.$message('规则已生成,打开控制台查看')
})
.finally(res => {
l.close()
})
},
}
};
</script>
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