Browse Source

修改区域价格

test
caoyizhong 2 years ago
parent
commit
ebd5bec066
  1. 50
      src/api/basicdata/basicdataCategory.js
  2. 50
      src/api/basicdata/basicdataPriceCorrelation.js
  3. 2
      src/option/basicdata/basicHistoricalContract.js
  4. 2
      src/option/basicdata/basicStorageServices.js
  5. 199
      src/option/basicdata/basicdataCategory.js
  6. 180
      src/option/basicdata/basicdataPriceCorrelation.js
  7. 2
      src/router/views/index.js
  8. 3
      src/views/basicdata/brand/basicClient.vue
  9. 18
      src/views/basicdata/brand/basicHistoricalContract.vue
  10. 3
      src/views/basicdata/brand/basicShop.vue
  11. 14
      src/views/basicdata/brand/basicStorageServices.vue
  12. 137
      src/views/basicdata/brand/basicZonePrice.vue
  13. 281
      src/views/basicdata/brand/basicdataCategory.vue
  14. 245
      src/views/basicdata/brand/basicdataPriceCorrelation.vue

50
src/api/basicdata/basicdataCategory.js

@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/submit',
method: 'post',
data: row
})
}

50
src/api/basicdata/basicdataPriceCorrelation.js

@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basicdata/basicdataPriceCorrelation/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/api/logpm-basicdata/basicdataPriceCorrelation/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/api/logpm-basicdata/basicdataPriceCorrelation/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/api/logpm-basicdata/basicdataPriceCorrelation/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/api/logpm-basicdata/basicdataPriceCorrelation/submit',
method: 'post',
data: row
})
}

2
src/option/basicdata/basicHistoricalContract.js

@ -105,7 +105,7 @@ export default {
},
{
label: "合同文件",
prop: "leaseAccessories",
prop: "fileName",
},
]
}

2
src/option/basicdata/basicStorageServices.js

@ -91,7 +91,7 @@ export default {
{
label: "门店名称",
prop: "storeName",
search: true,
hide: true,
},
{
label: "发货单位",

199
src/option/basicdata/basicdataCategory.js

@ -0,0 +1,199 @@
export default {
height:'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
indexLabel:'序号',
indexWidth: 80,
border: true,
index: true,
viewBtn: true,
selection: true,
dialogClickModal: false,
column: [
{
label: "主键",
prop: "id",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "租户号",
prop: "tenantId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建人",
prop: "createUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "更新人",
prop: "updateUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "更新时间",
prop: "updateTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "状态",
prop: "status",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "是否已删除",
prop: "isDeleted",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留1",
prop: "reserve1",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留2",
prop: "reserve2",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留3",
prop: "reserve3",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留4",
prop: "reserve4",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留5",
prop: "reserve5",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
// {
// label: "父ID",
// prop: "pid",
// type: "input",
// },
// {
// label: "一级编码",
// prop: "stairCode",
// type: "input",
// },
// {
// label: "一级名称",
// prop: "stairName",
// type: "input",
// },
// {
// label: "二级编码",
// prop: "secondCode",
// type: "input",
// },
// {
// label: "二级名称",
// prop: "secondName",
// type: "input",
// },
// {
// label: "三级编码",
// prop: "threeCode",
// type: "input",
// },
// {
// label: "三级名称",
// prop: "threeName",
// type: "input",
// },
// {
// label: "四级编码",
// prop: "fourCode",
// type: "input",
// },
// {
// label: "四级名称",
// prop: "fourName",
// type: "input",
// },
{
label: "名称",
prop: "name",
type: "input",
search: true,
},
{
label: "类型",
prop: "type",
type: "input",
search: true,
},
]
}

180
src/option/basicdata/basicdataPriceCorrelation.js

@ -0,0 +1,180 @@
export default {
height:'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: true,
selection: true,
dialogClickModal: false,
column: [
{
label: "主键",
prop: "id",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "租户号",
prop: "tenantId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建人",
prop: "createUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "更新人",
prop: "updateUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "更新时间",
prop: "updateTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "状态",
prop: "status",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "是否已删除",
prop: "isDeleted",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留1",
prop: "reserve1",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留2",
prop: "reserve2",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留3",
prop: "reserve3",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留4",
prop: "reserve4",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "预留5",
prop: "reserve5",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "客户ID",
prop: "clientId",
type: "input",
search: true,
},
{
label: "物品ID",
prop: "categoryId",
type: "input",
search: true,
},
{
label: "基础价格id",
prop: "freightId",
type: "input",
search: true,
},
{
label: "计价方式",
prop: "formulaMode",
type: "input",
search: true,
},
{
label: "服务类型",
prop: "typeService",
type: "input",
search: true,
},
{
label: "一口价",
prop: "fixedPrice",
type: "input",
},
{
label: "类型",
prop: "genre",
type: "input",
},
]
}

2
src/router/views/index.js

@ -223,7 +223,7 @@ export default [
i18n: 'dict',
},
props: route => ({ name: route.query.name,
id: route.query.id}),
id: route.query.id,type: route.query.type}),
component: () =>
import(/* webpackChunkName: "views" */ '@/views/basicdata/brand/basicStorageServices.vue'),
},

3
src/views/basicdata/brand/basicClient.vue

@ -731,7 +731,8 @@ export default {
path:'/basicdata/brand/basicStorageServices',
query:{
id: row.id,
name: "服务仓 - "+row.clientName
name: "服务仓 - "+row.clientName,
type: '2'
}
});

18
src/views/basicdata/brand/basicHistoricalContract.vue

@ -67,16 +67,19 @@
:width="item.width"
show-overflow-tooltip
:key="index" align="center">
<template #default="{row,$index}" v-if="item.prop === 'fileName'">
<el-link target="_blank" @click="downloadLink(row)">{{row.fileName}}</el-link>
</template>
</el-table-column>
</template>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
<!-- <el-table-column prop="menu" label="操作" :width="220" align="center">-->
<!-- <template #="{row}">-->
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>-->
</template>
</el-table-column>
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-row>
<el-row>
@ -243,6 +246,11 @@ export default {
}
},
methods: {
//
downloadLink(row){
console.log(">>>>>",row);
},
init () {
this.height = this.setPx(document.body.clientHeight - 340);
},

3
src/views/basicdata/brand/basicShop.vue

@ -518,7 +518,8 @@ export default {
path:'/basicdata/brand/basicStorageServices',
query:{
id: row.id,
name: "服务仓 - "+row.clientName
name: "服务仓 - "+row.clientName,
type: '1'
}
});
},

14
src/views/basicdata/brand/basicStorageServices.vue

@ -4,9 +4,9 @@
<el-row :hidden="!search" style="padding:6px 18px">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<el-form-item label="门店名称:">
<el-input v-model="query.shopId" placeholder="请输入门店名称"></el-input>
</el-form-item>
<!-- <el-form-item label="门店名称:">-->
<!-- <el-input v-model="query.shopId" placeholder="请输入门店名称"></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="发货单位:">
<el-input v-model="query.forwardingUnit" placeholder="请输入发货单位"></el-input>
</el-form-item>
@ -215,6 +215,8 @@ export default {
}
},
methods: {
remoteMethod(query,params = {}){
console.log(">>>",query);
if (query) {
@ -257,6 +259,9 @@ export default {
if (valid) {
if (!this.form.id) {
this.form.shopId = this.$route.query.id;
if(!!this.$route.query.type ){
this.form.distinguish = this.$route.query.type
}
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
@ -373,6 +378,9 @@ export default {
onLoad (page, params = {}) {
this.loading = true;
this.query.shopIds = this.$route.query.id;
if(!!this.$route.query.type ){
this.query.distinguish = this.$route.query.type
}
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;

137
src/views/basicdata/brand/basicZonePrice.vue

@ -4,9 +4,18 @@
<el-row :hidden="!search" style="padding:6px 18px">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<el-form-item label="地址:">
<el-form-item label="始发地地址:">
<!-- <el-input v-model="query.province" placeholder="请输入省"></el-input>-->
<el-cascader :options="optioner" v-model="query.province">
<el-cascader :options="optioner" v-model="query.province" :props="{ checkStrictly: true }" popper-class='ca'>
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="目的地地址:">
<!-- <el-input v-model="query.province" placeholder="请输入省"></el-input>-->
<el-cascader :options="optioner" v-model="query.provinceEnd" :props="{ checkStrictly: true }" popper-class='ca'>
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
@ -115,14 +124,67 @@
append-to-body>
<el-form :disabled="view" ref="form" :model="form" label-width="120px" :rules="rules">
<!-- 表单字段 -->
<el-form-item label="地址" prop="province">
<el-form-item label="始发仓地址" prop="province">
<!-- <el-input v-model="form.province" placeholder="请输入省"/>-->
<el-cascader :options="optioner" v-model="form.province" style="width: 100%;">
<el-cascader :options="optioner" v-model="form.province" style="width: 100%;" :props="{ checkStrictly: true }" popper-class='ca'>
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="始发仓" prop="goalGranary">
<!-- <el-input v-model="form.goalGranary" placeholder="请输入末端仓"/>-->
<el-select style="width: 100%"
v-model="form.beginGranary"
filterable
remote
reserve-keyword
placeholder="请输入始发仓"
:remote-method="remoteMethodBin"
:loading="loading"
>
<el-option
v-for="item in optionser"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="目的仓地址" prop="province">
<!-- <el-input v-model="form.province" placeholder="请输入省"/>-->
<el-cascader :options="optioner" v-model="form.provinceEnd" style="width: 100%;" :props="{ checkStrictly: true }" popper-class='ca'>
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="目的仓" prop="goalGranary">
<!-- <el-input v-model="form.goalGranary" placeholder="请输入末端仓"/>-->
<el-select style="width: 100%"
v-model="form.goalGranary"
filterable
remote
reserve-keyword
placeholder="请输入目的仓"
:remote-method="remoteMethodBin"
:loading="loading"
>
<el-option
v-for="item in optionser"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="市" prop="city">-->
<!-- <el-input v-model="form.city" placeholder="请输入市"/>-->
@ -130,14 +192,14 @@
<!-- <el-form-item label="区/县" prop="district">-->
<!-- <el-input v-model="form.district" placeholder="请输入区/县"/>-->
<!-- </el-form-item>-->
<el-form-item label="品牌" prop="brand">
<el-form-item label="货物类型" prop="brand">
<!-- <el-input v-model="form.brand" placeholder="请输入品牌"/>-->
<el-select style="width: 100%"
v-model="form.brand"
filterable
remote
reserve-keyword
placeholder="请选择品牌"
placeholder="货物类型"
:remote-method="remoteMethod"
:loading="loading"
>
@ -202,28 +264,6 @@
<!-- <el-form-item label="仓储时间端费用" prop="warehousingTimeCharge">-->
<!-- <el-input type="number" v-model="form.warehousingTimeCharge" placeholder="请输入仓储时间端费用"/>-->
<!-- </el-form-item>-->
<el-form-item label="末端仓" prop="goalGranary">
<!-- <el-input v-model="form.goalGranary" placeholder="请输入末端仓"/>-->
<el-select style="width: 100%"
v-model="form.goalGranary"
filterable
remote
reserve-keyword
placeholder="请输入末端仓"
:remote-method="remoteMethodBin"
:loading="loading"
>
<el-option
v-for="item in optionser"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="标识" prop="identification">-->
<!-- <el-input v-model="form.identification" placeholder="请输入标识"/>-->
<!-- </el-form-item>-->
@ -268,6 +308,15 @@ export default {
},
data () {
return {
optionProps:{
value: 'id',
label: 'cName',
children: 'childrenList', //
emitPath : false,
checkStrictly:true,
expandTrigger: 'hover' //
},
cascaderKey : 1,//,+1
height: 0,
//
title: '',
@ -336,6 +385,13 @@ export default {
},
}
},
watch: {
'form.province'() {
if (this.$refs.refHandle) {
this.$refs.refHandle.dropDownVisible = false; //
}
}
},
created() {
getLazyTreeAll().then( res => {
if(res.data.success){
@ -360,6 +416,12 @@ export default {
}
},
methods: {
//
hideCascaderInp(){
this.$refs.cascaderRef.value.togglePopperVisible(false)
},
handleDrawerClose(){
this.costCorrelationId = '';
this.drawer = false;
@ -704,3 +766,22 @@ export default {
}
};
</script>
<style>
.ca .el-radio__inner {
top: -18px;
left: -19px;
border-radius: 0;
border: 0;
width: 170px;
height: 34px;
background-color: transparent;
cursor: pointer;
box-sizing: border-box;
position: absolute;
}
.ca .el-radio__input.is-checked .el-radio__inner {
background: transparent;
}
</style>

281
src/views/basicdata/brand/basicdataCategory.vue

@ -0,0 +1,281 @@
<template>
<el-row>
<el-col :span="5">
<div class="box">
<el-scrollbar>
<basic-container>
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
</basic-container>
</el-scrollbar>
</div>
</el-col>
<el-col :span="19">
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template #menu-left>
<el-button type="danger"
icon="el-icon-delete"
plain
v-if="permission.basicdataCategory_delete"
@click="handleDelete">
</el-button>
<el-button type="warning"
plain
icon="el-icon-download"
@click="handleExport">
</el-button>
</template>
</avue-crud>
</basic-container>
</el-col>
</el-row>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/basicdata/basicdataCategory";
import option from "@/option/basicdata/basicdataCategory";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { getDeptLazyTree } from '@/api/system/dept';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: option,
data: [],
treeData: [],
treeOption: {
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
console.log("<<<<<<<<<<<<<<",node,resolve);
const parentId = node.level === 0 ? 0 : node.data.id;
getDeptLazyTree(parentId).then(res => {
console.log("res>",res)
resolve(
res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren,
};
})
);
});
},
addBtn: false,
menu: false,
size: 'small',
props: {
labelText: '标题',
label: 'title',
value: 'value',
children: 'children',
},
},
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataCategory_add, false),
viewBtn: this.validData(this.permission.basicdataCategory_view, false),
delBtn: this.validData(this.permission.basicdataCategory_delete, false),
editBtn: this.validData(this.permission.basicdataCategory_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
nodeClick(data) {
this.treeDeptId = data.id;
this.page.currentPage = 1;
this.onLoad(this.page);
},
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-basicdataCategory/basicdataCategory/export-basicdataCategory?${this.website.tokenHeader}=${getToken()}`;
const {
name,
type,
} = this.query;
let values = {
name_: name,
type_: type,
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `品类${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {
name,
type,
} = this.query;
let values = {
name_: name,
type_: type,
};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

245
src/views/basicdata/brand/basicdataPriceCorrelation.vue

@ -0,0 +1,245 @@
<template>
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template #menu-left>
<el-button type="danger"
icon="el-icon-delete"
plain
v-if="permission.basicdataPriceCorrelation_delete"
@click="handleDelete">
</el-button>
<el-button type="warning"
plain
icon="el-icon-download"
@click="handleExport">
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/basicdata/basicdataPriceCorrelation";
import option from "@/option/basicdata/basicdataPriceCorrelation";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: option,
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataPriceCorrelation_add, false),
viewBtn: this.validData(this.permission.basicdataPriceCorrelation_view, false),
delBtn: this.validData(this.permission.basicdataPriceCorrelation_delete, false),
editBtn: this.validData(this.permission.basicdataPriceCorrelation_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-basicdataPriceCorrelation/basicdataPriceCorrelation/export-basicdataPriceCorrelation?${this.website.tokenHeader}=${getToken()}`;
const {
clientId,
categoryId,
freightId,
formulaMode,
typeService,
} = this.query;
let values = {
clientId_like: clientId,
categoryId_like: categoryId,
freightId_like: freightId,
formulaMode_like: formulaMode,
typeService_like: typeService,
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `客户物品价格关联表${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {
clientId,
categoryId,
freightId,
formulaMode,
typeService,
} = this.query;
let values = {
clientId_like: clientId,
categoryId_like: categoryId,
freightId_like: freightId,
formulaMode_like: formulaMode,
typeService_like: typeService,
};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>
Loading…
Cancel
Save