4 changed files with 508 additions and 4 deletions
-
3src/api/purchaseorder/purchaseRequisition.js
-
4src/views/modules/knifemold/tool-info-list.vue
-
4src/views/modules/knifemold/tool-oi-record.vue
-
501src/views/modules/purchaseorder/approvalRecord.vue
@ -0,0 +1,501 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-button @click="getDataList()" type="primary">{{ buttons.search }}</el-button> |
||||
|
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }} |
||||
|
</el-button> |
||||
|
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button> |
||||
|
<download-excel |
||||
|
:fields="fields()" |
||||
|
:data="exportData" |
||||
|
type="xls" |
||||
|
:name="exportName" |
||||
|
:header="exportHeader" |
||||
|
:footer="exportFooter" |
||||
|
:defaultValue="exportDefaultValue" |
||||
|
:fetch="createExportData" |
||||
|
:before-generate="startDownload" |
||||
|
:before-finish="finishDownload" |
||||
|
worksheet="导出信息" |
||||
|
class="el-button el-button--primary el-button--medium"> |
||||
|
{{ buttons.download }} |
||||
|
</download-excel> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form :inline="true" label-position="top"> |
||||
|
<el-form-item :label="'申请单号'"> |
||||
|
<el-input style="width: 140px" v-model="queryHist.orderRef1"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'审核人'"> |
||||
|
<el-input style="width: 100px" v-model="queryHist.userDisplay"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'审核状态'"> |
||||
|
<el-select style="width: 100px" v-model="queryHist.authFlag"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="已审批" value="Y"></el-option> |
||||
|
<el-option label="未审批" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'审核日期'"> |
||||
|
<el-date-picker style="width: 120px" v-model="queryHist.startDate" |
||||
|
value-format='yyyy-MM-dd 00:00:00' |
||||
|
format='yyyy-MM-dd' |
||||
|
></el-date-picker> |
||||
|
- |
||||
|
<el-date-picker style="width: 120px" v-model="queryHist.endDate" |
||||
|
value-format='yyyy-MM-dd 23:59:59' |
||||
|
format='yyyy-MM-dd' |
||||
|
></el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
highlight-current-row |
||||
|
> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed==''?false:item.fixed" |
||||
|
:width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 动态列 --> |
||||
|
<column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import column from "../common/column"; |
||||
|
import Chooselist from '@/views/modules/common/Chooselist' |
||||
|
import { |
||||
|
searchSysLanguagePackList, |
||||
|
searchSysLanguageParam, |
||||
|
searchFunctionButtonList, |
||||
|
saveButtonList, |
||||
|
searchSysLanguage, |
||||
|
searchLanguageListByLanguageCode, |
||||
|
saveSysLanguageOne |
||||
|
} from "@/api/sysLanguage.js" |
||||
|
import { |
||||
|
saveTableDefaultList, |
||||
|
saveTableUser, |
||||
|
getTableDefaultListLanguage, |
||||
|
getTableUserListLanguage, |
||||
|
removerDefault, |
||||
|
removerUser |
||||
|
} from "@/api/table.js" |
||||
|
import { |
||||
|
getAuthorizationHists |
||||
|
} from '@/api/purchaseorder/purchaseRequisition.js' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
column, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
height: 0, |
||||
|
// 组件显示控制 |
||||
|
visible: false, |
||||
|
showDefault: this.$store.state.user.userDev, |
||||
|
// 数据查询属性 |
||||
|
tagNo: '', |
||||
|
dataListLoading: false, |
||||
|
queryHist: { |
||||
|
site: this.$store.state.user.site, |
||||
|
limit: 100, |
||||
|
page: 1, |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
orderRef1: '', |
||||
|
authFlag: '', |
||||
|
userDisplay: '', |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 100, |
||||
|
totalPage: 0, |
||||
|
// 数据集 |
||||
|
dataList: [], |
||||
|
// ------------ 页面属性 ---------- |
||||
|
// 默认table 查询参数 |
||||
|
queryTable: { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
languageCode: this.$i18n.locale |
||||
|
}, |
||||
|
// 用户table 查询参数 |
||||
|
queryTableUser: { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale |
||||
|
}, |
||||
|
// 获取页面按钮 |
||||
|
queryButton: { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
table_id: this.$route.meta.menuId + 'AR', |
||||
|
languageCode: this.$i18n.locale, |
||||
|
objectType: 'button' |
||||
|
}, |
||||
|
// 展示列集 |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "orderRef1", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "申请单号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "stepId", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审批步骤号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "nameDesc", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审批类型/审批人", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "userName", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审核人", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "actAuthorizeDate", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审批时间", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "approveResult", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审批状态", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
tableId: this.$route.meta.menuId + 'AR', |
||||
|
tableName: "ARH", |
||||
|
columnProp: "remark", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "审批备注", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
}, |
||||
|
], |
||||
|
// 用户table 配置集合 |
||||
|
userColumnList: [], |
||||
|
// 展示按钮 |
||||
|
buttons: { |
||||
|
search: '查询', |
||||
|
download: '导出', |
||||
|
settingTable: '设置列表', |
||||
|
defaultTable: '设置默认配置', |
||||
|
}, |
||||
|
// 按钮列表 |
||||
|
buttonList: [ |
||||
|
{ |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
languageValue: '查询', |
||||
|
objectId: 'search', |
||||
|
objectType: "button", |
||||
|
tableId: this.$route.meta.menuId + 'AR' |
||||
|
}, |
||||
|
{ |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
languageValue: '导出', |
||||
|
objectId: 'download', |
||||
|
objectType: "button", |
||||
|
tableId: this.$route.meta.menuId + 'AR' |
||||
|
}, |
||||
|
{ |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
languageValue: '设置列表', |
||||
|
objectId: 'settingTable', |
||||
|
objectType: "button", |
||||
|
tableId: this.$route.meta.menuId + 'AR' |
||||
|
}, |
||||
|
{ |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
languageValue: '设置默认配置', |
||||
|
objectId: 'defaultTable', |
||||
|
objectType: "button", |
||||
|
tableId: this.$route.meta.menuId + 'AR' |
||||
|
}, |
||||
|
], |
||||
|
// ------------ 页面属性 end ---------- |
||||
|
// 导出 start |
||||
|
exportData: [], |
||||
|
exportName: this.$route.meta.title, |
||||
|
exportHeader: [this.$route.meta.title], |
||||
|
exportFooter: [], |
||||
|
exportDefaultValue: "", |
||||
|
// 导出 end |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
activated() { |
||||
|
|
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 220; |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// --------------- 业务 ------------------- |
||||
|
getDataList() { |
||||
|
this.dataListLoading = true |
||||
|
this.queryHist.limit = this.pageSize |
||||
|
this.queryHist.page = this.pageIndex |
||||
|
getAuthorizationHists(this.queryHist).then(({data}) => { |
||||
|
if (data.code == 0) { |
||||
|
this.dataList = data.data.list |
||||
|
this.pageIndex = data.data.currPage |
||||
|
this.pageSize = data.data.pageSize |
||||
|
this.totalPage = data.data.totalCount |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// --------------- 业务 end ----------------- |
||||
|
// --------- 动态列配置 ---------- |
||||
|
// 打开页面设置 |
||||
|
userSetting() { |
||||
|
this.visible = true; |
||||
|
let queryTable = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: "common1001", |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.column.init(queryTable); |
||||
|
}); |
||||
|
}, |
||||
|
// 保存 默认配置 列 |
||||
|
async saveColumnList() { |
||||
|
// 删除所有的该页面下保存的数据 |
||||
|
if (this.userColumnList) { |
||||
|
//删除 user自定义的数据 |
||||
|
await removerUser(this.queryTable) |
||||
|
} |
||||
|
// 删除默认配置 |
||||
|
await removerDefault(this.queryTable) |
||||
|
// 保存页面 table属性 |
||||
|
let sumColumnList = this.columnList |
||||
|
sumColumnList = sumColumnList.map(item => { |
||||
|
return item = { |
||||
|
tableId: item.tableId, |
||||
|
tableName: item.tableName, |
||||
|
columnProp: item.columnProp, |
||||
|
columnLabel: item.columnLabel, |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: item.columnWidth, |
||||
|
headerAlign: item.headerAlign, |
||||
|
format: item.format, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
sortLv: item.sortLv, |
||||
|
status: true, |
||||
|
fixed: item.fixed, |
||||
|
serialNumber: item.serialNumber, |
||||
|
columnType: item.columnType, |
||||
|
align: item.align |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
await saveTableDefaultList(sumColumnList) |
||||
|
// 保存页面 button label title 属性 |
||||
|
let buttons = this.buttonList.map(item => { |
||||
|
return item = { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
languageValue: item.languageValue, |
||||
|
objectId: item.objectId, |
||||
|
objectType: item.objectType, |
||||
|
tableId: item.tableId |
||||
|
} |
||||
|
}) |
||||
|
await saveButtonList(buttons) |
||||
|
this.getFunctionButtonList() |
||||
|
this.getColumnList() |
||||
|
}, |
||||
|
// 获取 用户保存的 格式列 |
||||
|
getTableUserColumn() { |
||||
|
getTableUserListLanguage(this.queryTableUser).then(({data}) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
//this.columnList = [] |
||||
|
this.columnList = data.rows |
||||
|
} else { |
||||
|
this.getColumnList() |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
// 获取 tableDefault 列 |
||||
|
getColumnList() { |
||||
|
getTableDefaultListLanguage(this.queryTable).then(({data}) => { |
||||
|
if (!data.rows.length == 0) { |
||||
|
// this.showDefault = false |
||||
|
this.columnList = data.rows |
||||
|
} else { |
||||
|
// this.showDefault = true |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取button的词典 |
||||
|
getFunctionButtonList() { |
||||
|
searchFunctionButtonList(this.queryButton).then(({data}) => { |
||||
|
if (JSON.stringify(data.data) != '{}') { |
||||
|
this.buttons = data.data |
||||
|
} else { |
||||
|
// saveButtonList(this.buttonList).then(({data}) => { |
||||
|
// }) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// --------- 动态列配置 end ---------- |
||||
|
// --------- 分页 ---------- |
||||
|
// 每页数 |
||||
|
sizeChangeHandle(val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// 当前页 |
||||
|
currentChangeHandle(val) { |
||||
|
this.pageIndex = val |
||||
|
this.getDataList() |
||||
|
}, |
||||
|
// --------- 分页 end ---------- |
||||
|
// --------- 导出 ---------- |
||||
|
fields() { |
||||
|
let json = "{" |
||||
|
this.columnList.forEach((item, index) => { |
||||
|
if (index == this.columnList.length - 1) { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
||||
|
} else { |
||||
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
||||
|
} |
||||
|
}) |
||||
|
json += "}" |
||||
|
let s = eval("(" + json + ")") |
||||
|
return s |
||||
|
}, |
||||
|
createExportData() { |
||||
|
// 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据 |
||||
|
return this.dataList; |
||||
|
}, |
||||
|
startDownload() { |
||||
|
}, |
||||
|
finishDownload() { |
||||
|
} |
||||
|
// --------- 导出 end ---------- |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableUserColumn() |
||||
|
this.getFunctionButtonList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue