Browse Source

新增价格列表

dev-xx
qb 12 months ago
parent
commit
3cecd0660a
  1. 74
      src/api/Pricesystem/index.js
  2. 2
      src/components/MyPrint/MyPrint.vue
  3. 104
      src/option/Pricesystem/index.js
  4. 521
      src/views/Pricesystem/ListOfPriceSystems.vue
  5. 19
      src/views/distribution/artery/truckLoadingDetails.vue

74
src/api/Pricesystem/index.js

@ -0,0 +1,74 @@
import request from '@/axios';
//基础价格模板新增
export const $_priceTemplate = data => {
return request({
url: '/api/logpm-basicdata/priceTemplate',
method: 'post',
data,
});
};
// 品牌
export const $_basicdataBrande = params => {
return request({
url: '/api/logpm-basicdata/basicdataBrand/lists',
method: 'get',
params,
});
};
//查询列表接口
export const getBasicdataPrice = params => {
return request({
url: '/api/logpm-basicdata/basicdataPrice',
method: 'get',
params,
});
};
/**
* 提交基础配置
* @returns
*/
export const postBasicdataPrice = data => {
return request({
url: '/api/logpm-basicdata/basicdataPrice',
method: 'patch',
data,
});
};
// 删除模板
export const $_deletelpriceTemplate = params => {
return request({
url: '/api/logpm-basicdata/priceTemplate',
method: 'delete',
params,
});
};
// 修改模板
export const $_putpriceTemplate = data => {
return request({
url: '/api/logpm-basicdata/priceTemplate',
method: 'put',
data,
});
};
// 查看详情
export const $_InfopriceTemplate = params => {
return request({
url: '/api/logpm-basicdata/priceTemplate/' + params.id,
method: 'get',
});
};
// 菜单临时删除模
export const $_tempDelpriceTemplate = params => {
return request({
url: '/api/logpm-basicdata/priceTemplate',
method: 'patch',
params,
});
};

2
src/components/MyPrint/MyPrint.vue

@ -118,6 +118,8 @@ const createExcel = () => {
wrapText: false, //
},
};
item.t = 's';
}
/* 导出 Workbook 到 Excel 文件 */

104
src/option/Pricesystem/index.js

@ -0,0 +1,104 @@
export const columnList = [
{
prop: '',
label: '复选框',
type: 0,
width: 55,
fixed: true,
},
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
prop: 'clientName',
label: '客户名称',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'brandName',
label: '品牌',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'serviceType',
label: '服务类型',
type: 3,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'maintenanceStatus',
label: '维护状态',
type: 3,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'updateTime',
label: '修改时间',
type: 4,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'effectiveTime',
label: '生效时间',
type: 4,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'expiryTime',
label: '到期时间',
type: 4,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'createUserName',
label: '操作',
type: 6,
values: '',
width: '200',
checkarr: [],
fixed: 'right',
sortable: false,
},
];

521
src/views/Pricesystem/ListOfPriceSystems.vue

@ -0,0 +1,521 @@
<template>
<basic-container v-loading="details.loadingObj.pageLoading">
<!-- 首页表格 -->
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="header_search">
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
</el-form-item>
</el-form>
</div>
<!-- 控件模块 -->
<div class="flex-c-sb">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left"></div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChangeS" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="columnList"
:tableData="details.data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<el-button @click="handleClient(slotProps.scope.row)">基础配置</el-button>
<el-button
v-if="slotProps.scope.row.maintenanceStatus === '已维护'"
@click="Modifytemplate(slotProps.scope.row)"
>价格体系配置</el-button
>
</div>
</template>
</template>
</tablecmt>
<!-- 分页模块 -->
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div></div>
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
</div>
</basic-container>
<el-dialog
class="el-dialog-basicVisted"
label-width="100px"
v-model="details.popUpShow.basicVisted"
title="基础配置"
width="40%"
:before-close="handleClose"
>
<el-form inline :model="details.form" ref="basicForm" label-width="120px">
<el-form-item label="客户名称" prop="clientName">
<el-input placeholder="客户名称" v-model="details.form.clientName" />
</el-form-item>
<el-form-item label="品牌" prop="brandName">
<el-input placeholder="品牌" v-model="details.form.brandName" />
</el-form-item>
<el-form-item
label="生效时间"
:rules="{ required: true, message: '请选择生效时间', trigger: ['change', 'blur'] }"
prop="effectiveTime"
>
<el-date-picker
v-model="details.form.effectiveTime"
type="date"
placeholder="请选择生效时间"
:disabled-date="time1"
:shortcuts="shortcuts"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item
label="到期时间"
:rules="{ required: true, message: '请选择到期时间', trigger: ['change', 'blur'] }"
prop="expiryTime"
>
<el-date-picker
v-model="details.form.expiryTime"
type="date"
placeholder="请选择到期时间"
:disabled-date="time2"
:shortcuts="shortcuts"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item
label="价格体系模板"
:rules="{ required: true, message: '请选择体系模板', trigger: ['change', 'blur'] }"
prop="templateId"
>
<el-select
v-model="details.form.templateId"
placeholder="请选择价格体系模板"
style="width: 240px"
>
<el-option
v-for="item in details.templateArr"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="details.popUpShow.basicVisted = false">取消</el-button>
<el-button type="primary" @click="handleSubmitBasic"> 提交 </el-button>
</span>
</template>
</el-dialog>
<!-- 列表配置显示 -->
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.columnList"
></edittablehead>
</template>
<script setup>
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue';
import { columnList } from '@/option/Pricesystem/index.js';
import { $_getpriceTemplate, $_deletelpriceTemplate } from '@/api/financialsector/index'; //
import { getBasicdataPrice, postBasicdataPrice } from '@/api/Pricesystem/index'; //
import { getDictionaryBiz } from '@/api/system/dict'; //
import { processRowProperty, setNodeHeight } from '@/utils/util';
import functions from '@/utils/functions.js';
import { ElMessageBox, ElMessage } from 'element-plus';
import { downloadXls } from '@/utils/util';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
const $router = useRouter(); //
const $useStore = useStore(); //
const $route = useRoute(); //
const details = reactive({
/** 是否开启搜索 */
search: false,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 时间选择器数据 */
stockupDate: [],
/** 列表 */
columnList,
/** 列表数据 */
data: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
/** 页面loading */
pageLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
currentPage: 1,
pageSize: 50,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 基础配置 */
basicVisted: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 价格模板数组 */
templateArr: [],
});
/** 生效时间 -- 生效时间不能大于到期时间 */
const time1 = time => {
if (!details.form.expiryTime) return false;
return time.getTime() > new Date(details.form.expiryTime).getTime();
};
/** 到期时间 -- 到期时间不能小于生效时间 */
const time2 = time => {
if (!details.form.effectiveTime) return false;
return time.getTime() < new Date(details.form.effectiveTime).getTime();
};
/** 基础配置表单实例 */
const basicForm = ref();
const { search, query, data, loadingObj, drawerShow, page } = toRefs(details);
/**
* 设置列表 -- 固定函数
* 弹窗的勾选回调用于更改头部数组
* 固定搭配只需要更换 columnList
* */
const setnewcolum = (newarr, headarr, type) => {
if (type == 1) {
details.columnList = newarr;
functions.setStorage(window.location.pathname + 'checkList', headarr);
} else if (type == 2) {
details.columnList = newarr;
functions.setStorage(window.location.pathname + 'flexList', headarr);
} else if (type == 3) {
details.columnList = newarr;
functions.setStorage(window.location.pathname + 'sortlist', headarr);
}
};
/** 展开列表控件 */
const showdrawer = _flag => {
details.drawerShow = _flag;
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
details.query[row.prop] = index;
if (!index) delete details.query[row.prop];
processRowProperty(index, row, details);
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
};
/** 表格表头输入框搜索 */
const btnsc = val => {
console.log(val);
};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
processRowProperty(index, row, details);
};
/** 表格表头复选框选择 */
const selectionChange = list => {
console.log(list);
details.selectionList = list;
};
//
const searchChange = () => {
details.search = false; //
};
//
const sizeChange = val => {
page.value.pageSize = val;
};
/** 页码改变执行的回调 */
const currentChange = val => {
page.value.currentPage = val;
};
//
const searchChangeS = () => {
details.search = false; //
onLoad();
};
//
const searchHide = () => {
console.log(details);
details.search = !details.search;
const _node = document.querySelector('.tableNode');
setNodeHeight(_node, '', true);
};
//
function updateDictionary(targetArray, dictionaryType) {
getDictionaryBiz(dictionaryType).then(res => {
console.log(res, '字典');
res.data.data.forEach(item => {
targetArray.push({
value: item.dictKey,
label: item.dictValue,
});
});
});
}
//
const onLoad = async () => {
try {
const submitData = {
...details.page,
...details.query,
};
const res = await getBasicdataPrice(submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.page.total = data.total;
details.data = data.records;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
onLoad();
//
const Addtemplate = () => {
$router.push({
path: '/financialsector/FinanceHome',
});
};
//
const Deletetemplate = () => {
console.log(details.selectionList, ' details.selectionList');
if (!details.selectionList.length) {
ElMessage({
message: '请勾选要删除的模板',
type: 'warning',
});
return;
}
ElMessageBox.confirm('是否删除选中模板?此操作不可撤销!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
details.loadingObj.list = true;
let data = {
ids: details.selectionList.map(res => res.id).join(','),
};
$_deletelpriceTemplate(data).then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
onLoad();
}
});
})
.catch(res => {
console.log(res, 'error');
})
.finally(() => {
details.loadingObj.list = false;
});
};
//
const Modifytemplate = row => {
console.log(row);
$router.push({
query: {
id: row.id,
},
path: '/financialsector/FinanceHome',
});
};
/** 设置客户 */
const handleClient = async row => {
try {
details.loadingObj.pageLoading = true;
const res = await $_getpriceTemplate({ brandId: row.brandId });
const { code, data } = res.data;
if (code !== 200) return;
details.templateArr = data.records || [];
details.popUpShow.basicVisted = true;
await nextTick();
//
basicForm.value.resetFields();
details.form = { ...row };
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
console.log('row :>> ', row);
};
/** 提交设置基础配置 */
const handleSubmitBasic = () => {
basicForm.value.validate(async (valid, fields) => {
if (!valid) return;
try {
details.loadingObj.pageLoading = true;
details.popUpShow.basicVisted = false;
const submitData = {
effectiveTime: details.form.effectiveTime + ' 00:00:00',
id: details.form.id,
expiryTime: details.form.expiryTime + ' 00:00:00',
templateId: details.form.templateId,
};
const res = await postBasicdataPrice(submitData);
const { code, msg } = res.data;
if (code !== 200) return;
ElMessage.success(msg);
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
});
};
</script>
<style scoped lang="scss">
.ElBtnClass button {
border: none;
padding: 0;
background-color: transparent;
color: #02a7f0;
font-weight: 400;
}
:deep(.el-card) {
height: 100%;
}
:deep(.el-card__body) {
height: 100%;
display: flex;
flex-direction: column;
}
.el-fy {
flex: 1;
display: flex;
align-items: flex-end;
margin-bottom: 10px;
}
.avue-crud {
height: 100%;
display: flex;
flex-direction: column;
}
//
.el-dialog-basicVisted .el-form-item {
width: 40%;
}
:deep(.el-date-editor) {
height: 100% !important;
}
</style>

19
src/views/distribution/artery/truckLoadingDetails.vue

@ -1254,22 +1254,23 @@ watch(
:deep(.el-table tr) {
&.Abnormal {
background: #e54b4b;
// background: #e54b4b;
.tabculconte,
.el-tooltip,
.el-button--text,
.el-text {
color: #fff !important;
// color: #e54b4b !important;
color: #f00 !important;
}
}
&.hover-row {
.tabculconte,
.el-tooltip,
.el-button--text {
color: var(--el-color-primary) !important;
}
}
// &.hover-row {
// .tabculconte,
// .el-tooltip,
// .el-button--text {
// color: var(--el-color-primary) !important;
// }
// }
}
</style>

Loading…
Cancel
Save