398 lines
13 KiB
Vue
398 lines
13 KiB
Vue
<template>
|
|
<XdPageContainer class="app-container">
|
|
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="30" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
|
|
|
<el-form-item label="线路" prop="lineCode">
|
|
<TransLinePicker v-model="queryParams.lineCode" isInitiated="true" ></TransLinePicker>
|
|
</el-form-item>
|
|
<el-form-item label="产品类型" prop="productType">
|
|
<TransProductPicker placeholder="产品类型" v-model="queryParams.productType" :transLineCode="queryParams.lineCode" ></TransProductPicker>
|
|
</el-form-item>
|
|
<el-form-item label="起始网点" prop="startSiteCode">
|
|
<EmisSiteSimplePicker1 v-model="queryParams.startSiteCode" ></EmisSiteSimplePicker1>
|
|
</el-form-item>
|
|
<el-form-item label="下一网点" prop="nextSiteCode">
|
|
<EmisSiteSimplePicker1 v-model="queryParams.nextSiteCode" ></EmisSiteSimplePicker1>
|
|
</el-form-item>
|
|
<el-form-item label="供应商" prop="supplierCode">
|
|
<EmisSupplierPicker :placeholder="$t('请选择')" v-model="queryParams.supplierCode" ></EmisSupplierPicker>
|
|
</el-form-item>
|
|
<el-form-item label="节点负责人" prop="manager" label-width="100px">
|
|
<EmpNamePicker :placeholder="$t('节点负责人')" v-model="queryParams.manager" ></EmpNamePicker>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="生效时间" prop="startDate">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.startDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
:placeholder="$t('生效时间')">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="失效时间" prop="endDate">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.endDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
:placeholder="$t('失效时间')">
|
|
</el-date-picker>
|
|
</el-form-item> -->
|
|
|
|
</SearchForm>
|
|
|
|
|
|
<XdTable
|
|
|
|
slot="pageContent"
|
|
slot-scope="slotProps"
|
|
:height="(slotProps.contentHeight)+'px'"
|
|
|
|
v-loading="loading"
|
|
|
|
ref="refTable"
|
|
|
|
storageName="emisTransPlanRuleList_main_240707"
|
|
|
|
size="mini"
|
|
|
|
border
|
|
stripe
|
|
|
|
:data="emisTransPlanRuleList"
|
|
:showSearch.sync="showSearch"
|
|
:queryParams="queryParams"
|
|
:total="total"
|
|
@queryTable="getList"
|
|
@selection-change="handleSelectionChange"
|
|
@sort-change="handleSortChange"
|
|
>
|
|
|
|
<div slot="toolbar">
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
v-hasPermi="['emis:emisTransPlanRule:add']"
|
|
>新增规则</el-button>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
plain
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['emis:emisTransPlanRule:edit']"
|
|
>修改规则</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
v-hasPermi="['emis:emisTransPlanRule:remove']"
|
|
>删除</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['emis:emisTransPlanRule:export']"
|
|
>导出</el-button>
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
size="mini"
|
|
@click="handleBatchReCalc"
|
|
v-hasPermi="['emis:emisTransPlanRule:edit']"
|
|
>按线路重算</el-button>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column :label="$t('线路名称')" align="center" prop="lineName" min-width="120" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('产品名称')" align="center" prop="productTypeName" min-width="150" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('起始网点')" align="center" prop="startSiteName" min-width="100" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('节点负责人')" align="center" prop="manager" min-width="100" />
|
|
<el-table-column :label="$t('线路负责人')" align="center" prop="transManager" min-width="100" />
|
|
<el-table-column :label="$t('供应商')" align="center" prop="supplierName" min-width="180" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('生效时间')" align="center" prop="startDate" min-width="100" />
|
|
<el-table-column :label="$t('失效时间')" align="center" prop="endDate" min-width="100" />
|
|
|
|
<el-table-column label="创建人" align="center" prop="createByName" width="80"/>
|
|
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
|
|
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
|
|
|
|
</XdTable>
|
|
|
|
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
|
|
<emisTransPlanRuleForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTransPlanRuleForm>
|
|
</el-dialog>
|
|
|
|
</XdPageContainer>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisTransPlanRule, getEmisTransPlanRule, delEmisTransPlanRule, addEmisTransPlanRule, updateEmisTransPlanRule } from "@/api/emis/emisTransPlanRule";
|
|
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
|
|
|
import { autoScanSiteBatch } from "@/api/emis/emisCommon"
|
|
|
|
import emisTransPlanRuleForm from '@/views/emis/emisTransPlanRule/emisTransPlanRuleForm';
|
|
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
|
|
|
|
import EmisSiteSimplePicker1 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
|
import EmisSiteSimplePicker2 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
|
|
|
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
|
|
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
|
|
|
|
import EmpNamePicker from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
|
|
|
|
|
export default {
|
|
name: "EmisTransPlanRule",
|
|
components: {
|
|
elDateSimplePicker,
|
|
emisTransPlanRuleForm,
|
|
EmisSupplierPicker,
|
|
EmisSiteSimplePicker1,
|
|
EmisSiteSimplePicker2,
|
|
TransLinePicker,
|
|
TransProductPicker,
|
|
EmpNamePicker
|
|
},
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 创建时间搜索
|
|
dateTimeRange:[],
|
|
// 总条数
|
|
total: 0,
|
|
// 供应商线路规划表表格数据
|
|
emisTransPlanRuleList: [],
|
|
selectList:null,
|
|
|
|
currentId:null,
|
|
openForm: false,
|
|
titleForm: "",
|
|
|
|
// 弹出展示层
|
|
id:null,
|
|
titleView:"",
|
|
openView: false,
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 20,
|
|
lineCode: null,
|
|
productType: null,
|
|
startSiteCode: null,
|
|
nextSiteCode: null,
|
|
manager: null,
|
|
supplierCode: null,
|
|
startDate: null,
|
|
endDate: null,
|
|
remark: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
createSite: null,
|
|
updateSite: null
|
|
},
|
|
};
|
|
},
|
|
created() {
|
|
this.getList();
|
|
},
|
|
methods: {
|
|
/** 查询供应商线路规划表列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
listEmisTransPlanRule(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
|
|
this.emisTransPlanRuleList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
this.selectList = selection
|
|
},
|
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
|
handleSortChange(column) {
|
|
this.queryParams.orderByColumn = column.prop;
|
|
this.queryParams.isAsc = column.order;
|
|
this.getList();
|
|
},
|
|
/** 新增按钮操作 */
|
|
handleAdd(row) {
|
|
this.currentId=null;
|
|
this.openForm= true;
|
|
this.titleForm = "新增规则";
|
|
},
|
|
handleShowMoreInput(){
|
|
this.moreInputVisible = !this.moreInputVisible;
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
this.currentId= row.id||this.ids[0];
|
|
this.openForm = true;
|
|
this.titleForm = "修改规则";
|
|
},
|
|
handleView(row) {
|
|
this.id=row.id;
|
|
this.titleView="查看";
|
|
this.openView=true;
|
|
// this.router.push({ path: '/emis/emisTransPlanRule/viewDetail', query: { id: row.id }})
|
|
},
|
|
handleFormChanged(){
|
|
this.currentId=null;
|
|
this.openForm = false;
|
|
this.getList();
|
|
},
|
|
cancelForm(){
|
|
this.currentId=null;
|
|
this.openForm = false;
|
|
},
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
this.$modal.confirm('是否确认删除').then(function() {
|
|
return delEmisTransPlanRule(ids);
|
|
}).then(() => {
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {});
|
|
},
|
|
handleBatchReCalc(){
|
|
if(this.selectList&&this.selectList.length>0){
|
|
let lineCode=this.selectList[0].lineCode;
|
|
this.$modal.confirm('确认是否重算').then(function() {
|
|
return autoScanSiteBatch(lineCode);
|
|
}).then(() => {
|
|
this.getList();
|
|
this.$modal.msgSuccess("重算成功");
|
|
}).catch(() => {});
|
|
}
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
const loadingInstance = this.$loading({
|
|
text: '正在导出...'
|
|
})
|
|
|
|
if(this.selectList&&this.selectList.length>0){
|
|
this.exportData(this.selectList,loadingInstance);
|
|
}
|
|
else{
|
|
let qExportParam={...this.queryParams};
|
|
qExportParam=this.addDateRange(qExportParam, this.dateTimeRange,'createTime')
|
|
qExportParam.pageNum=1;
|
|
qExportParam.pageSize=20000;
|
|
|
|
listEmisTransPlanRule(qExportParam).then(response => {
|
|
if (response.code === 200) {
|
|
this.exportData(response.rows,loadingInstance);
|
|
}
|
|
});
|
|
}
|
|
},
|
|
exportData(selData,loadingInstance){
|
|
const curList =selData
|
|
import('@/vendor/Export2Excel').then(excel => {
|
|
const exportParam=this.$refs.refTable.getExportParam();
|
|
const tHeader = exportParam.header;
|
|
const filterVal = exportParam.filter;
|
|
const data = this.formatJson(filterVal, curList, selData)
|
|
excel.export_json_to_excel({
|
|
header: tHeader,
|
|
data,
|
|
filename: '批次规则列表',
|
|
autoWidth: true
|
|
})
|
|
loadingInstance.close()
|
|
})
|
|
},
|
|
formatJson(filterVal, jsonData, resData) {
|
|
let index = 0
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
|
if (j === 'index') {
|
|
return ++index
|
|
}
|
|
|
|
return v[j]
|
|
}))
|
|
},
|
|
|
|
/** 列索引函数 */
|
|
getIndex($index) {
|
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
|
},
|
|
/** 时间搜索响应函数 */
|
|
dateTimeChange(value){
|
|
this.dateTimeRange=value;
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.el-divider{
|
|
margin-top: 0px;
|
|
background: 0 0;
|
|
border-top: 1px solid #E6EBF5;
|
|
}
|
|
.el-divider__text {
|
|
color: #0955ee;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|