6 changed files with 594 additions and 12 deletions
-
9src/api/knifemold/tool-info.js
-
2src/views/modules/knifemold/tool-info-list.vue
-
30src/views/modules/knifemold/tool-info.vue
-
261src/views/modules/knifemold/toolAttribute.vue
-
300src/views/modules/knifemold/toolCost.vue
-
4src/views/modules/print/label/print_tool_label_preview.js
@ -0,0 +1,261 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form :inline="true" label-position="top"> |
||||
|
<el-form-item :label="'工具编码'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.partNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'工具名称'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.toolDescription" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'属性编码'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.propertiesItemNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'属性名称'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.itemDesc" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<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"> |
||||
|
导出 |
||||
|
</download-excel> |
||||
|
</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" |
||||
|
style="width: 100%;"> |
||||
|
<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" |
||||
|
:min-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="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import column from '../common/column' |
||||
|
import {getToolAttributeList} from '@/api/knifemold/tool-info.js' |
||||
|
export default { |
||||
|
components: {column}, |
||||
|
data () { |
||||
|
return { |
||||
|
height: 0, |
||||
|
// 数据查询属性 |
||||
|
dataListLoading: false, |
||||
|
queryTool: { |
||||
|
limit: 500, |
||||
|
page: 1, |
||||
|
site: this.$store.state.user.site, |
||||
|
recordType: 'T', |
||||
|
partNo: '', |
||||
|
toolDescription: '', |
||||
|
propertiesItemNo: '', |
||||
|
itemDesc: '' |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
dataList: [], |
||||
|
columnList: [ |
||||
|
{ |
||||
|
columnProp: 'partNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '工具编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'toolDescription', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '工具名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'propertiesItemNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '属性编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'itemDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '属性名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'valueType', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '属性值类型', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'textValue', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '文本值', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'numValue', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '数值', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
} |
||||
|
], |
||||
|
exportData: [], |
||||
|
exportName: this.$route.meta.title, |
||||
|
exportHeader: [this.$route.meta.title], |
||||
|
exportFooter: [], |
||||
|
exportDefaultValue: '' |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 220 |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// --------------- 业务 ------------------- |
||||
|
getDataList () { |
||||
|
this.dataListLoading = true |
||||
|
this.queryTool.limit = this.pageSize |
||||
|
this.queryTool.page = this.pageIndex |
||||
|
getToolAttributeList(this.queryTool).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
// --------- 分页 ---------- |
||||
|
// 每页数 |
||||
|
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.getDataList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,300 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form :inline="true" label-position="top"> |
||||
|
<el-form-item :label="'工具编码'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.toolId" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'工具名称'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.toolDescription" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'实例编码'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.toolInstanceId" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'客户'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.customer" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'出资方'"> |
||||
|
<el-input style="width: 100px" v-model="queryTool.contributor" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<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"> |
||||
|
导出 |
||||
|
</download-excel> |
||||
|
</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" |
||||
|
style="width: 100%;"> |
||||
|
<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" |
||||
|
:min-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="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import column from '../common/column' |
||||
|
import {getToolCostList} from '@/api/knifemold/tool-info.js' |
||||
|
export default { |
||||
|
components: {column}, |
||||
|
data () { |
||||
|
return { |
||||
|
height: 0, |
||||
|
// 数据查询属性 |
||||
|
dataListLoading: false, |
||||
|
queryTool: { |
||||
|
limit: 500, |
||||
|
page: 1, |
||||
|
site: this.$store.state.user.site, |
||||
|
toolId: '', |
||||
|
toolDescription: '', |
||||
|
toolInstanceId: '', |
||||
|
customer: '', |
||||
|
contributor: '' |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
dataList: [], |
||||
|
columnList: [ |
||||
|
{ |
||||
|
columnProp: 'toolId', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '工具编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'toolDescription', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '工具名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'toolInstanceId', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '工具实例编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'locationName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '库位', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'status', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '状态', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'purchaseDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '购买日期', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'steelSeal', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '钢印编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'price', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: '价格', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'customer', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '客户', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'contributor', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '出资方', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '' |
||||
|
} |
||||
|
], |
||||
|
exportData: [], |
||||
|
exportName: this.$route.meta.title, |
||||
|
exportHeader: [this.$route.meta.title], |
||||
|
exportFooter: [], |
||||
|
exportDefaultValue: '' |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 220 |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// --------------- 业务 ------------------- |
||||
|
getDataList () { |
||||
|
this.dataListLoading = true |
||||
|
this.queryTool.limit = this.pageSize |
||||
|
this.queryTool.page = this.pageIndex |
||||
|
getToolCostList(this.queryTool).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.dataList = data.page.list |
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
// --------- 分页 ---------- |
||||
|
// 每页数 |
||||
|
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.getDataList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue